aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2014-04-26 15:59:50 -0400
committerMaxime Ripard <maxime.ripard@free-electrons.com>2014-05-04 02:59:44 -0400
commit4409cafc1a4ce73ffc4a2107cda85fc1f034def0 (patch)
tree6bbb8217b09c3b21a37242e9e6fa10bafced2c2b /drivers/pinctrl
parentd10acc635330d6089601fd01d482ecda32e02c45 (diff)
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')
-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 c8b321ae6b17..f0e908702ebe 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)
794 struct pinctrl_pin_desc *pins; 794 struct pinctrl_pin_desc *pins;
795 struct sunxi_pinctrl *pctl; 795 struct sunxi_pinctrl *pctl;
796 struct reset_control *rstc; 796 struct reset_control *rstc;
797 struct resource *res;
797 int i, ret, last_pin; 798 int i, ret, last_pin;
798 struct clk *clk; 799 struct clk *clk;
799 800
@@ -804,9 +805,10 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev)
804 805
805 spin_lock_init(&pctl->lock); 806 spin_lock_init(&pctl->lock);
806 807
807 pctl->membase = of_iomap(node, 0); 808 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
808 if (!pctl->membase) 809 pctl->membase = devm_ioremap_resource(&pdev->dev, res);
809 return -ENOMEM; 810 if (IS_ERR(pctl->membase))
811 return PTR_ERR(pctl->membase);
810 812
811 device = of_match_device(sunxi_pinctrl_match, &pdev->dev); 813 device = of_match_device(sunxi_pinctrl_match, &pdev->dev);
812 if (!device) 814 if (!device)