summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/sunxi
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2014-04-26 21:59:50 +0200
committerMaxime Ripard <maxime.ripard@free-electrons.com>2014-05-03 23:59:44 -0700
commit4409cafc1a4ce73ffc4a2107cda85fc1f034def0 (patch)
tree6bbb8217b09c3b21a37242e9e6fa10bafced2c2b /drivers/pinctrl/sunxi
parentd10acc635330d6089601fd01d482ecda32e02c45 (diff)
downloadop-kernel-dev-4409cafc1a4ce73ffc4a2107cda85fc1f034def0.zip
op-kernel-dev-4409cafc1a4ce73ffc4a2107cda85fc1f034def0.tar.gz
pinctrl: sunxi: Switch to devm_ioremap_resource
The previous code was calling of_iomap, which doesn't do any resource management, and doesn't call request_mem_region either. Use devm_ioremap_resource that do both. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Diffstat (limited to 'drivers/pinctrl/sunxi')
-rw-r--r--drivers/pinctrl/sunxi/pinctrl-sunxi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
index c8b321a..f0e9087 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -794,6 +794,7 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev)
struct pinctrl_pin_desc *pins;
struct sunxi_pinctrl *pctl;
struct reset_control *rstc;
+ struct resource *res;
int i, ret, last_pin;
struct clk *clk;
@@ -804,9 +805,10 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev)
spin_lock_init(&pctl->lock);
- pctl->membase = of_iomap(node, 0);
- if (!pctl->membase)
- return -ENOMEM;
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ pctl->membase = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(pctl->membase))
+ return PTR_ERR(pctl->membase);
device = of_match_device(sunxi_pinctrl_match, &pdev->dev);
if (!device)
OpenPOWER on IntegriCloud