]> git.ipfire.org Git - people/ms/u-boot.git/commit
devres: make Devres optional with CONFIG_DEVRES
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Sat, 25 Jul 2015 12:52:37 +0000 (21:52 +0900)
committerSimon Glass <sjg@chromium.org>
Thu, 6 Aug 2015 13:44:29 +0000 (07:44 -0600)
commite2282d70763ddf06f9b02007445729c841ef4083
tree8e0461a2455375eed3b66e1fc322fe265ce1e171
parent2b07f6859ad17b74ce490f371f4878add6ae5a11
devres: make Devres optional with CONFIG_DEVRES

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@socionext.com>
Suggested-by: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
drivers/core/Kconfig
drivers/core/Makefile
drivers/core/device.c
include/dm/device-internal.h
include/dm/device.h