[U-Boot] [PATCH v12 1/8] dm: drop unused helper in MTD header
Jagan Teki
jagan at openedev.com
Mon Oct 1 16:15:45 UTC 2018
On Monday 01 October 2018 07:10 PM, Miquel Raynal wrote:
> Hi Jagan,
>
> Jagan Teki <jagan at amarulasolutions.com> wrote on Mon, 1 Oct 2018
> 17:08:30 +0530:
>
>> On Mon, Oct 1, 2018 at 3:32 PM Miquel Raynal <miquel.raynal at bootlin.com> wrote:
>>>
>>> Hi Jagan,
>>>
>>> Jagan Teki <jagan at amarulasolutions.com> wrote on Mon, 1 Oct 2018
>>> 15:23:46 +0530:
>>>
>>>> On Sat, Sep 29, 2018 at 4:29 PM Miquel Raynal <miquel.raynal at bootlin.com> wrote:
>>>>>
>>>>> include/mtd.h might be included by files even if CONFIG_DM is not
>>>>> enabled. In this case, the call to dev_get_uclass_priv() would trigger
>>>>> a build error. Because this helper has no user, let's drop it off.
>>>>
>>>> Why would they use DM include file w/o using it? we need to fix in those places.
>>>
>>> There was no user of include/mtd.h not using CONFIG_DM.
>>>
>>> But now I am creating cmd/mtd.c which should work with both CONFIG_DM
>>> and no CONFIG_DM support. So include/mtd.h has reasons to be included.
>>
>> Then use ifdef CONFIG_MTD on the same file so it can arrange dm and
>> non-dm include at one place.
>
> The helper is not used, why do we keep it?
The whole point of placing ifdef is to support dm and non-dm at one include.
More information about the U-Boot
mailing list