summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-05-31 11:05:12 +0300
committerLinus Walleij <linus.walleij@linaro.org>2016-05-31 13:40:38 +0300
commitfc78a56631d13901dd8bac5efb46e8fdcd89976b (patch)
tree129599977215b09da52c470848562b8ddde9349e /drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c
parent4109508a85f5f51b3dcb1fb53674eec2beac60e1 (diff)
downloadlinux-fc78a56631d13901dd8bac5efb46e8fdcd89976b.tar.xz
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-pro4.c')
-rw-r--r--drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c10
1 files changed, 3 insertions, 7 deletions
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[] = {