]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
memory: emif: Simplify code handling CONFIG_OF
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Sun, 17 Dec 2023 19:31:32 +0000 (20:31 +0100)
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tue, 23 Jan 2024 15:15:57 +0000 (16:15 +0100)
The first thing that of_get_memory_device_details() does is calling
of_parse_phandle(). With CONFIG_OF=n this returns NULL in a static
inline function. So the compiler can determine that
of_get_memory_device_details() also returns NULL. bloat-o-meter confirms
that this patch has no effects on the size of the generated code for
CONFIG_OF=n builds.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/9d53683c34a730c8579a1468b643b11d1379106e.1702829744.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
drivers/memory/emif.c

index f5e654abe04c43ebf61a7fe1445e13dd7a827510..c5a24501db9b4359b419902c1456f856cd25fc3e 100644 (file)
@@ -826,7 +826,6 @@ static int is_custom_config_valid(struct emif_custom_configs *cust_cfgs,
        return valid;
 }
 
-#if defined(CONFIG_OF)
 static void __init_or_module of_get_custom_configs(struct device_node *np_emif,
                struct emif_data *emif)
 {
@@ -983,15 +982,6 @@ out:
        return emif;
 }
 
-#else
-
-static struct emif_data * __init_or_module of_get_memory_device_details(
-               struct device_node *np_emif, struct device *dev)
-{
-       return NULL;
-}
-#endif
-
 static struct emif_data *__init_or_module get_device_details(
                struct platform_device *pdev)
 {