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

Simon Glass sjg at chromium.org
Wed Jul 29 05:30:06 CEST 2015


On 25 July 2015 at 06:52, 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 an 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>
> Acked-by: Simon Glass <sjg at chromium.org>
> ---
>
> Changes in v4:
>   - drop a comment that does not make sense
>
> Changes in v3:
>   - Introduce CONFIG_DEVRES
>   - Surround devres_head member with ifdef CONFIG_DEVRES
>
> Changes in v2: None
>
>  drivers/core/Kconfig         | 15 +++++++-
>  drivers/core/Makefile        |  3 +-
>  drivers/core/device.c        |  2 ++
>  include/dm/device-internal.h | 13 +++++++
>  include/dm/device.h          | 82 ++++++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 113 insertions(+), 2 deletions(-)

Applied to u-boot-dm, thanks!


More information about the U-Boot mailing list