[U-Boot] [PATCH v2 25/32] dm: usb: Convert USB storage to use driver-model for block devs

Marek Vasut marex at denx.de
Sun Mar 13 18:41:25 CET 2016


On 03/13/2016 02:53 AM, Simon Glass wrote:
> Hi Marek,
> 
> On 29 February 2016 at 16:04, Marek Vasut <marex at denx.de> wrote:
>> On 02/29/2016 11:25 PM, Simon Glass wrote:
>>> Update this code to support CONFIG_BLK. Each USB storage device can have
>>> one or more block devices as children, each one representing a LUN
>>> (logical unit) of the USB device.
>>>
>>> Signed-off-by: Simon Glass <sjg at chromium.org>
>>> ---
>>>
>>> Changes in v2: None
>>>
>>>  common/usb_storage.c | 141 ++++++++++++++++++++++++++++++++++++++++++++++++---
>>>  1 file changed, 135 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/common/usb_storage.c b/common/usb_storage.c
>>> index 0475123..1472824 100644
>>> --- a/common/usb_storage.c
>>> +++ b/common/usb_storage.c
>>> @@ -43,6 +43,7 @@
>>>  #include <asm/byteorder.h>
>>>  #include <asm/processor.h>
>>>  #include <dm/device-internal.h>
>>> +#include <dm/lists.h>
>>>
>>>  #include <part.h>
>>>  #include <usb.h>
>>> @@ -67,7 +68,9 @@ static __u32 CBWTag;
>>>
>>>  static int usb_max_devs; /* number of highest available usb device */
>>>
>>> +#ifndef CONFIG_BLK
>>>  static struct blk_desc usb_dev_desc[USB_MAX_STOR_DEV];
>>> +#endif
>>
>> You might want to use __maybe_unused to avoid the ifdef, do you think it
>> makes sense ?
> 
> This is something that should not exist when driver model is used. So
> I'd rather have it explicit so it is obvious that it can be removed
> with the driver-model conversion is done.

OK fine.

>>
>>>  struct us_data;
>>>  typedef int (*trans_cmnd)(ccb *cb, struct us_data *data);
>>
>> Other than that:
>>
>> Reviewed-by: Marek Vasut <marex at denx.de>
>>
>> --
>> Best regards,
>> Marek Vasut
> 
> Regards,
> Simon
> 


-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list