summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-05-31 17:05:12 +0900
committerLinus Walleij <linus.walleij@linaro.org>2016-05-31 12:40:38 +0200
commitfc78a56631d13901dd8bac5efb46e8fdcd89976b (patch)
tree129599977215b09da52c470848562b8ddde9349e /drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c
parent4109508a85f5f51b3dcb1fb53674eec2beac60e1 (diff)
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-sld8.c')
-rw-r--r--drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c
index 915259f13ea8..caf53800e794 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c
@@ -754,6 +754,8 @@ static const struct uniphier_pinmux_function uniphier_sld8_functions[] = {
};
static struct uniphier_pinctrl_socdata uniphier_sld8_pindata = {
+ .pins = uniphier_sld8_pins,
+ .npins = ARRAY_SIZE(uniphier_sld8_pins),
.groups = uniphier_sld8_groups,
.groups_count = ARRAY_SIZE(uniphier_sld8_groups),
.functions = uniphier_sld8_functions,
@@ -763,15 +765,9 @@ static struct uniphier_pinctrl_socdata uniphier_sld8_pindata = {
.load_pinctrl = false,
};
-static struct pinctrl_desc uniphier_sld8_pinctrl_desc = {
- .pins = uniphier_sld8_pins,
- .npins = ARRAY_SIZE(uniphier_sld8_pins),
-};
-
static int uniphier_sld8_pinctrl_probe(struct platform_device *pdev)
{
- return uniphier_pinctrl_probe(pdev, &uniphier_sld8_pinctrl_desc,
- &uniphier_sld8_pindata);
+ return uniphier_pinctrl_probe(pdev, &uniphier_sld8_pindata);
}
static const struct of_device_id uniphier_sld8_pinctrl_match[] = {