[U-Boot] [PATCH 2/4] dm: core: Add DM_FLAG_PRE_OS_FINALIZE flag

Stefan Roese sr at denx.de
Wed Apr 19 09:49:36 UTC 2017


Hi Simon,

On 09.04.2017 21:28, Simon Glass wrote:
> Hi Stefan,
>
> On 6 April 2017 at 07:29, Stefan Roese <sr at denx.de> wrote:
>> This new flag can be added to DM device drivers, which need to do some
>> final configuration before U-Boot exits and the OS (e.g. Linux) is
>> started. The remove functions of those drivers will get called at
>> this stage to do these last-stage configuration steps.
>>
>> Signed-off-by: Stefan Roese <sr at denx.de>
>> Cc: Simon Glass <sjg at chromium.org>
>> Cc: Bin Meng <bmeng.cn at gmail.com>
>> ---
>>  drivers/core/device-remove.c | 17 ++++++++++++-----
>>  include/dm/device.h          | 11 ++++++++++-
>>  2 files changed, 22 insertions(+), 6 deletions(-)
>
> Reviewed-by: Simon Glass <sjg at chromium.org>
>
> You could perhaps have a separate patch to move the code into
> flags_remove(), but I suppose it isn't important.
>
> nit below.
>
>>
>> diff --git a/drivers/core/device-remove.c b/drivers/core/device-remove.c
>> index 8b46f3343e..390be5a0d8 100644
>> --- a/drivers/core/device-remove.c
>> +++ b/drivers/core/device-remove.c
>> @@ -148,6 +148,16 @@ void device_free(struct udevice *dev)
>>         devres_release_probe(dev);
>>  }
>>
>> +static int flags_remove(uint flags, uint drv_flags)
>
> Can this be bool, and return true/false?

I'm not a big fan of bool but I've no hard feelings here. I'll change
this if you prefer it this way in v2.

>> +{
>> +       if ((flags & DM_REMOVE_NORMAL) ||
>> +           (flags & (drv_flags &
>> +                     (DM_FLAG_ACTIVE_DMA | DM_FLAG_PRE_OS_FINALIZE))))
>
> What do you think about OS_PREPARE instead? It doesn't really finalize
> the OS...

Much better, thanks. Will change in v2.

Thanks,
Stefan


More information about the U-Boot mailing list