]> git.kernelconcepts.de Git - karo-tx-uboot.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)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 10 Sep 2015 06:17:18 +0000 (08:17 +0200)
commit7471f06454818f883eed6076f3a0153f02348df2
treefb2d8331becc428d32622d07c57d9b37aeef28f4
parent2b78358de6bb9ccc379dd5e7ee61542b90177d32
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