[U-Boot] [PATCH] 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 ---
I have tested it with blk scsi which I am reworking after first RFC. With this patch I can run scsi part, scsi info, scsi read (I didn't test write not to break my HDD).
--- drivers/block/blk-uclass.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index 6ba1026f5818..2e041c2b3dc7 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; }

On 16 November 2016 at 09:37, Michal Simek michal.simek@xilinx.com wrote:
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
I have tested it with blk scsi which I am reworking after first RFC. With this patch I can run scsi part, scsi info, scsi read (I didn't test write not to break my HDD).
drivers/block/blk-uclass.c | 2 ++ 1 file changed, 2 insertions(+)
Reviewed-by: Simon Glass sjg@chromium.org

On 17 November 2016 at 18:15, Simon Glass sjg@chromium.org wrote:
On 16 November 2016 at 09:37, Michal Simek michal.simek@xilinx.com wrote:
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
I have tested it with blk scsi which I am reworking after first RFC. With this patch I can run scsi part, scsi info, scsi read (I didn't test write not to break my HDD).
drivers/block/blk-uclass.c | 2 ++ 1 file changed, 2 insertions(+)
Reviewed-by: Simon Glass sjg@chromium.org
Applied to u-boot-dm, thanks!
participants (2)
-
Michal Simek
-
Simon Glass