From fc78a56631d13901dd8bac5efb46e8fdcd89976b Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 31 May 2016 17:05:12 +0900 Subject: pinctrl: uniphier: allocate struct pinctrl_desc in probe function Currently, every SoC driver defines struct pinctrl_desc statically, i.e. it consumes memory footprint even if it is not probed. In multi-platform, many pinctrl drivers are linked (generally as built-in objects), although only one of them is actually used. So, it is reasonable to allocate memory dynamically where possible. Signed-off-by: Masahiro Yamada Signed-off-by: Linus Walleij --- drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c') diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c index 7fcaeb5a510a..d88b351a7a37 100644 --- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c +++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c @@ -1520,6 +1520,8 @@ static const struct uniphier_pinmux_function uniphier_pro4_functions[] = { }; static struct uniphier_pinctrl_socdata uniphier_pro4_pindata = { + .pins = uniphier_pro4_pins, + .npins = ARRAY_SIZE(uniphier_pro4_pins), .groups = uniphier_pro4_groups, .groups_count = ARRAY_SIZE(uniphier_pro4_groups), .functions = uniphier_pro4_functions, @@ -1529,15 +1531,9 @@ static struct uniphier_pinctrl_socdata uniphier_pro4_pindata = { .load_pinctrl = true, }; -static struct pinctrl_desc uniphier_pro4_pinctrl_desc = { - .pins = uniphier_pro4_pins, - .npins = ARRAY_SIZE(uniphier_pro4_pins), -}; - static int uniphier_pro4_pinctrl_probe(struct platform_device *pdev) { - return uniphier_pinctrl_probe(pdev, &uniphier_pro4_pinctrl_desc, - &uniphier_pro4_pindata); + return uniphier_pinctrl_probe(pdev, &uniphier_pro4_pindata); } static const struct of_device_id uniphier_pro4_pinctrl_match[] = { -- cgit v1.2.3