From e2282d70763ddf06f9b02007445729c841ef4083 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sat, 25 Jul 2015 21:52:37 +0900 Subject: 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 Suggested-by: Simon Glass Acked-by: Simon Glass --- drivers/core/Kconfig | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'drivers/core/Kconfig') diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig index a002d69d79..8ae0072aa9 100644 --- a/drivers/core/Kconfig +++ b/drivers/core/Kconfig @@ -79,9 +79,22 @@ config SYSCON by this uclass, including accessing registers via regmap and assigning a unique number to each. +config DEVRES + bool "Managed device resources" + depends on DM + help + This option enables the Managed device resources core support. + Device resources managed by the devres framework are automatically + released whether initialization fails half-way or the device gets + detached. + + If this option is disabled, devres functions fall back to + non-managed variants. For example, devres_alloc() to kzalloc(), + devm_kmalloc() to kmalloc(), etc. + config DEBUG_DEVRES bool "Managed device resources verbose debug messages" - depends on DM + depends on DEVRES help If this option is enabled, devres debug messages are printed. Select this if you are having a problem with devres or want to -- cgit v1.2.3