From: Michal Simek Date: Wed, 16 Nov 2016 16:37:42 +0000 (+0100) Subject: dm: blk: Fix get_desc to return block device descriptor X-Git-Tag: v2017.01-rc1~70^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4408f6f445acc242efc8dcf3c346ca3f3a9bc9f0;p=platform%2Fkernel%2Fu-boot.git 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 Reviewed-by: Simon Glass --- diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index 6ba1026..2e041c2 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; }