summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2016-11-16 17:37:42 +0100
committerSimon Glass <sjg@chromium.org>2016-12-02 20:53:19 -0700
commit4408f6f445acc242efc8dcf3c346ca3f3a9bc9f0 (patch)
treec08a7ec091d05bda81631b2c5cdb8f16d419aa13 /drivers
parent2f11cd9121658b65a1d0789b37f290b207993a34 (diff)
downloadu-boot-4408f6f445acc242efc8dcf3c346ca3f3a9bc9f0.tar.gz
u-boot-4408f6f445acc242efc8dcf3c346ca3f3a9bc9f0.tar.bz2
u-boot-4408f6f445acc242efc8dcf3c346ca3f3a9bc9f0.zip
dm: blk: Fix get_desc to return block device descriptor
Current get_desc() implementation is not able to succesfully finish and return pointer to block device descriptor. Also function always return non zero value even device is found. The patch fills block device descriptor and return 0 if device is found. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/blk-uclass.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c
index 6ba1026f58..2e041c2b3d 100644
--- a/drivers/block/blk-uclass.c
+++ b/drivers/block/blk-uclass.c
@@ -156,6 +156,8 @@ static int get_desc(enum if_type if_type, int devnum, struct blk_desc **descp)
if (ret)
return ret;
+ *descp = desc;
+ return 0;
} else if (desc->devnum > devnum) {
found_more = true;
}