diff options
author | Jisheng Zhang <jszhang@marvell.com> | 2015-10-16 10:37:06 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-10-16 17:10:57 +0300 |
commit | d5c79fcb193ff825e5d5759cdbbb4a16385fb08f (patch) | |
tree | a5e71fc56b362dc65d10ff889e60f9f788fdd70e /drivers/pinctrl/berlin/berlin.c | |
parent | 69c308e2bcc303ab3eebb9b554de598dd4597b75 (diff) | |
download | linux-d5c79fcb193ff825e5d5759cdbbb4a16385fb08f.tar.xz |
pinctrl: berlin: introduce berlin_pinctrl_probe_regmap()
This is to prepare for the next berlin4ct support, where we won't use
simple-mfd any more.
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/berlin/berlin.c')
-rw-r--r-- | drivers/pinctrl/berlin/berlin.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c index f49580617055..898afa460e9a 100644 --- a/drivers/pinctrl/berlin/berlin.c +++ b/drivers/pinctrl/berlin/berlin.c @@ -292,20 +292,14 @@ static struct pinctrl_desc berlin_pctrl_desc = { .owner = THIS_MODULE, }; -int berlin_pinctrl_probe(struct platform_device *pdev, - const struct berlin_pinctrl_desc *desc) +int berlin_pinctrl_probe_regmap(struct platform_device *pdev, + const struct berlin_pinctrl_desc *desc, + struct regmap *regmap) { struct device *dev = &pdev->dev; - struct device_node *parent_np = of_get_parent(dev->of_node); struct berlin_pinctrl *pctrl; - struct regmap *regmap; int ret; - regmap = syscon_node_to_regmap(parent_np); - of_node_put(parent_np); - if (IS_ERR(regmap)) - return PTR_ERR(regmap); - pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL); if (!pctrl) return -ENOMEM; @@ -330,3 +324,17 @@ int berlin_pinctrl_probe(struct platform_device *pdev, return 0; } + +int berlin_pinctrl_probe(struct platform_device *pdev, + const struct berlin_pinctrl_desc *desc) +{ + struct device *dev = &pdev->dev; + struct device_node *parent_np = of_get_parent(dev->of_node); + struct regmap *regmap = syscon_node_to_regmap(parent_np); + + of_node_put(parent_np); + if (IS_ERR(regmap)) + return PTR_ERR(regmap); + + return berlin_pinctrl_probe_regmap(pdev, desc, regmap); +} |