* [U-Boot] [PATCH] dm: blk: Use uclass_find_first/next_device() in blk_first/next_device()
@ 2017-11-29 15:46 Stefan Roese
2017-11-30 6:16 ` Bin Meng
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Stefan Roese @ 2017-11-29 15:46 UTC (permalink / raw)
To: u-boot
This patch changes the calls to uclass_first/next_device() in blk_first/
next_device() to use uclass_find_first/next_device() instead. These functions
don't prepare the devices, which is correct in this case.
With this patch applied, the "usb storage" command now works again as
expected:
=> usb storage
Device 0: Vendor: SanDisk Rev: 1.00 Prod: Ultra
Type: Removable Hard Disk
Capacity: 58656.0 MB = 57.2 GB (120127488 x 512)
Without this patch, it used to generate this buggy output:
=> usb storage
Card did not respond to voltage select!
mmc_init: -95, time 26
No storage devices, perhaps not 'usb start'ed..?
Signed-off-by: Stefan Roese <sr@denx.de>
Suggested-by: Simon Glass <sjg@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
---
drivers/block/blk-uclass.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c
index 537cf5f0bb..010ed32d3a 100644
--- a/drivers/block/blk-uclass.c
+++ b/drivers/block/blk-uclass.c
@@ -10,6 +10,7 @@
#include <dm.h>
#include <dm/device-internal.h>
#include <dm/lists.h>
+#include <dm/uclass-internal.h>
static const char *if_typename_str[IF_TYPE_COUNT] = {
[IF_TYPE_IDE] = "ide",
@@ -331,7 +332,7 @@ int blk_first_device(int if_type, struct udevice **devp)
struct blk_desc *desc;
int ret;
- ret = uclass_first_device(UCLASS_BLK, devp);
+ ret = uclass_find_first_device(UCLASS_BLK, devp);
if (ret)
return ret;
if (!*devp)
@@ -340,7 +341,7 @@ int blk_first_device(int if_type, struct udevice **devp)
desc = dev_get_uclass_platdata(*devp);
if (desc->if_type == if_type)
return 0;
- ret = uclass_next_device(devp);
+ ret = uclass_find_next_device(devp);
if (ret)
return ret;
} while (*devp);
@@ -356,7 +357,7 @@ int blk_next_device(struct udevice **devp)
desc = dev_get_uclass_platdata(*devp);
if_type = desc->if_type;
do {
- ret = uclass_next_device(devp);
+ ret = uclass_find_next_device(devp);
if (ret)
return ret;
if (!*devp)
--
2.15.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] dm: blk: Use uclass_find_first/next_device() in blk_first/next_device()
2017-11-29 15:46 [U-Boot] [PATCH] dm: blk: Use uclass_find_first/next_device() in blk_first/next_device() Stefan Roese
@ 2017-11-30 6:16 ` Bin Meng
2017-12-02 3:32 ` Simon Glass
2017-12-08 17:11 ` sjg at google.com
2 siblings, 0 replies; 4+ messages in thread
From: Bin Meng @ 2017-11-30 6:16 UTC (permalink / raw)
To: u-boot
On Wed, Nov 29, 2017 at 11:46 PM, Stefan Roese <sr@denx.de> wrote:
> This patch changes the calls to uclass_first/next_device() in blk_first/
> next_device() to use uclass_find_first/next_device() instead. These functions
> don't prepare the devices, which is correct in this case.
>
> With this patch applied, the "usb storage" command now works again as
> expected:
>
> => usb storage
> Device 0: Vendor: SanDisk Rev: 1.00 Prod: Ultra
> Type: Removable Hard Disk
> Capacity: 58656.0 MB = 57.2 GB (120127488 x 512)
>
> Without this patch, it used to generate this buggy output:
>
> => usb storage
> Card did not respond to voltage select!
> mmc_init: -95, time 26
> No storage devices, perhaps not 'usb start'ed..?
>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Suggested-by: Simon Glass <sjg@chromium.org>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Bin Meng <bmeng.cn@gmail.com>
> ---
> drivers/block/blk-uclass.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] dm: blk: Use uclass_find_first/next_device() in blk_first/next_device()
2017-11-29 15:46 [U-Boot] [PATCH] dm: blk: Use uclass_find_first/next_device() in blk_first/next_device() Stefan Roese
2017-11-30 6:16 ` Bin Meng
@ 2017-12-02 3:32 ` Simon Glass
2017-12-08 17:11 ` sjg at google.com
2 siblings, 0 replies; 4+ messages in thread
From: Simon Glass @ 2017-12-02 3:32 UTC (permalink / raw)
To: u-boot
On 29 November 2017 at 08:46, Stefan Roese <sr@denx.de> wrote:
> This patch changes the calls to uclass_first/next_device() in blk_first/
> next_device() to use uclass_find_first/next_device() instead. These functions
> don't prepare the devices, which is correct in this case.
>
> With this patch applied, the "usb storage" command now works again as
> expected:
>
> => usb storage
> Device 0: Vendor: SanDisk Rev: 1.00 Prod: Ultra
> Type: Removable Hard Disk
> Capacity: 58656.0 MB = 57.2 GB (120127488 x 512)
>
> Without this patch, it used to generate this buggy output:
>
> => usb storage
> Card did not respond to voltage select!
> mmc_init: -95, time 26
> No storage devices, perhaps not 'usb start'ed..?
>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Suggested-by: Simon Glass <sjg@chromium.org>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Bin Meng <bmeng.cn@gmail.com>
> ---
> drivers/block/blk-uclass.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] dm: blk: Use uclass_find_first/next_device() in blk_first/next_device()
2017-11-29 15:46 [U-Boot] [PATCH] dm: blk: Use uclass_find_first/next_device() in blk_first/next_device() Stefan Roese
2017-11-30 6:16 ` Bin Meng
2017-12-02 3:32 ` Simon Glass
@ 2017-12-08 17:11 ` sjg at google.com
2 siblings, 0 replies; 4+ messages in thread
From: sjg at google.com @ 2017-12-08 17:11 UTC (permalink / raw)
To: u-boot
On 29 November 2017 at 08:46, Stefan Roese <sr@denx.de> wrote:
> This patch changes the calls to uclass_first/next_device() in blk_first/
> next_device() to use uclass_find_first/next_device() instead. These functions
> don't prepare the devices, which is correct in this case.
>
> With this patch applied, the "usb storage" command now works again as
> expected:
>
> => usb storage
> Device 0: Vendor: SanDisk Rev: 1.00 Prod: Ultra
> Type: Removable Hard Disk
> Capacity: 58656.0 MB = 57.2 GB (120127488 x 512)
>
> Without this patch, it used to generate this buggy output:
>
> => usb storage
> Card did not respond to voltage select!
> mmc_init: -95, time 26
> No storage devices, perhaps not 'usb start'ed..?
>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Suggested-by: Simon Glass <sjg@chromium.org>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Bin Meng <bmeng.cn@gmail.com>
> ---
> drivers/block/blk-uclass.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
Applied to u-boot-dm thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-12-08 17:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-29 15:46 [U-Boot] [PATCH] dm: blk: Use uclass_find_first/next_device() in blk_first/next_device() Stefan Roese
2017-11-30 6:16 ` Bin Meng
2017-12-02 3:32 ` Simon Glass
2017-12-08 17:11 ` sjg at google.com
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.