Commit 4409cafc authored by Maxime Ripard's avatar Maxime Ripard

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: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
parent d10acc63
...@@ -794,6 +794,7 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev) ...@@ -794,6 +794,7 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev)
struct pinctrl_pin_desc *pins; struct pinctrl_pin_desc *pins;
struct sunxi_pinctrl *pctl; struct sunxi_pinctrl *pctl;
struct reset_control *rstc; struct reset_control *rstc;
struct resource *res;
int i, ret, last_pin; int i, ret, last_pin;
struct clk *clk; struct clk *clk;
...@@ -804,9 +805,10 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev) ...@@ -804,9 +805,10 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev)
spin_lock_init(&pctl->lock); spin_lock_init(&pctl->lock);
pctl->membase = of_iomap(node, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!pctl->membase) pctl->membase = devm_ioremap_resource(&pdev->dev, res);
return -ENOMEM; if (IS_ERR(pctl->membase))
return PTR_ERR(pctl->membase);
device = of_match_device(sunxi_pinctrl_match, &pdev->dev); device = of_match_device(sunxi_pinctrl_match, &pdev->dev);
if (!device) if (!device)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment