Skip to content

Commit

Permalink
pinctrl: sunxi: Switch to devm_ioremap_resource
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Maxime Ripard committed May 4, 2014
1 parent d10acc6 commit 4409caf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/pinctrl/sunxi/pinctrl-sunxi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
Expand Down

0 comments on commit 4409caf

Please sign in to comment.