diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2016-05-31 10:05:12 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-05-31 12:40:38 +0200 |
commit | fc78a56631d13901dd8bac5efb46e8fdcd89976b (patch) | |
tree | 129599977215b09da52c470848562b8ddde9349e /drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c | |
parent | pinctrl: uniphier: set pinctrl_desc name in common probe function (diff) | |
download | linux-fc78a56631d13901dd8bac5efb46e8fdcd89976b.tar.xz linux-fc78a56631d13901dd8bac5efb46e8fdcd89976b.zip |
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 <yamada.masahiro@socionext.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c')
-rw-r--r-- | drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c index 246e2bed6ef0..8c48f31d2bd5 100644 --- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c +++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c @@ -1229,6 +1229,8 @@ static const struct uniphier_pinmux_function uniphier_pxs2_functions[] = { }; static struct uniphier_pinctrl_socdata uniphier_pxs2_pindata = { + .pins = uniphier_pxs2_pins, + .npins = ARRAY_SIZE(uniphier_pxs2_pins), .groups = uniphier_pxs2_groups, .groups_count = ARRAY_SIZE(uniphier_pxs2_groups), .functions = uniphier_pxs2_functions, @@ -1238,15 +1240,9 @@ static struct uniphier_pinctrl_socdata uniphier_pxs2_pindata = { .load_pinctrl = false, }; -static struct pinctrl_desc uniphier_pxs2_pinctrl_desc = { - .pins = uniphier_pxs2_pins, - .npins = ARRAY_SIZE(uniphier_pxs2_pins), -}; - static int uniphier_pxs2_pinctrl_probe(struct platform_device *pdev) { - return uniphier_pinctrl_probe(pdev, &uniphier_pxs2_pinctrl_desc, - &uniphier_pxs2_pindata); + return uniphier_pinctrl_probe(pdev, &uniphier_pxs2_pindata); } static const struct of_device_id uniphier_pxs2_pinctrl_match[] = { |