[U-Boot] [PATCH v4 1/3] dm: implement a MTD uclass

Simon Glass sjg at chromium.org
Sat Nov 7 00:58:15 CET 2015


Hi Thomas,

On 6 November 2015 at 05:25, Thomas Chou <thomas at wytron.com.tw> wrote:
> Hi Simon,
>
> On 2015年11月06日 20:06, Simon Glass wrote:
>>>
>>> diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
>>> index e3d3fc7..0ab6128 100644
>>> --- a/include/linux/mtd/mtd.h
>>> +++ b/include/linux/mtd/mtd.h
>>> @@ -18,6 +18,7 @@
>>>
>>>   #include <asm/div64.h>
>>>   #else
>>> +#include <dm.h>
>>
>>
>> I'm not keen on adding this header here. Why is it needed? Can we
>> instead include <m.h> in the C files that need it?
>>
>
> It is needed for the udevice in mtd_info. Some drivers use mtd.h but are not
> converted to driver model. Maybe I should remove the dm here, and add an
> #elif for the udevice below?

Are you sure? It should be possible to declare a 'struct udevice *'
without this header.

>
>>>   #include <linux/compat.h>
>>>   #include <mtd/mtd-abi.h>
>>>   #include <asm/errno.h>
>>> @@ -272,6 +273,8 @@ struct mtd_info {
>>>          struct module *owner;
>>>   #ifndef __UBOOT__
>>>          struct device dev;
>>> +#else
>
>
> #elif CONFIG_IS_ENABLED(MTD)
>
>>> +       struct udevice *dev;
>>>   #endif
>>>          int usecount;
>>>   };
>
>
> Thanks a lot for your review.
>
> Best regards,
> Thomas

Regards,
Simon


More information about the U-Boot mailing list