[U-Boot] [PATCH v3 4/5] devres: make Devres optional with CONFIG_DEVRES

Simon Glass sjg at chromium.org
Fri Jul 24 01:20:57 CEST 2015


On 23 July 2015 at 00:17, Masahiro Yamada <yamada.masahiro at socionext.com> wrote:
> Currently, Devres requires additional 16 byte for each allocation,
> which is not so insignificant in some cases.
>
> Add CONFIG_DEVRES to make this framework optional.
> If the option is disabled, devres functions fall back to
> non-managed variants.  For example, devres_alloc() to kzalloc(),
> devm_kmalloc() to kmalloc(), etc.
>
> Because devres_head is also surrounded by the ifdef conditional,
> there is no memory overhead when CONFIG_DEVRES is disabled.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
> Suggested-by: Simon Glass <sjg at chromium.org>
> ---
>
> Changes in v3:
>   - Introduce CONFIG_DEVRES
>   - Surround devres_head member with ifdef CONFIG_DEVRES
>
> Changes in v2: None
>
>  drivers/core/Kconfig         | 14 +++++++-
>  drivers/core/Makefile        |  3 +-
>  drivers/core/device.c        |  2 ++
>  include/dm/device-internal.h | 13 +++++++
>  include/dm/device.h          | 86 ++++++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 116 insertions(+), 2 deletions(-)

Acked-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list