Skip to content

Commit

Permalink
pinctrl: adi2: Convert to devm_ioremap_resource
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Axel Lin authored and Linus Walleij committed Sep 27, 2013
1 parent 2467f11 commit c8690d6
Showing 1 changed file with 6 additions and 32 deletions.
38 changes: 6 additions & 32 deletions drivers/pinctrl/pinctrl-adi2.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,22 +855,9 @@ static int adi_gpio_pint_probe(struct platform_device *pdev)
}

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(dev, "Invalid mem resource\n");
return -ENODEV;
}

if (!devm_request_mem_region(dev, res->start, resource_size(res),
pdev->name)) {
dev_err(dev, "Region already claimed\n");
return -EBUSY;
}

pint->base = devm_ioremap(dev, res->start, resource_size(res));
if (!pint->base) {
dev_err(dev, "Could not ioremap\n");
return -ENOMEM;
}
pint->base = devm_ioremap_resource(dev, res);
if (IS_ERR(pint->base))
return PTR_ERR(pint->base);

pint->regs = (struct gpio_pint_regs *)pint->base;

Expand Down Expand Up @@ -984,22 +971,9 @@ static int adi_gpio_probe(struct platform_device *pdev)
}

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(dev, "Invalid mem resource\n");
return -ENODEV;
}

if (!devm_request_mem_region(dev, res->start, resource_size(res),
pdev->name)) {
dev_err(dev, "Region already claimed\n");
return -EBUSY;
}

port->base = devm_ioremap(dev, res->start, resource_size(res));
if (!port->base) {
dev_err(dev, "Could not ioremap\n");
return -ENOMEM;
}
port->base = devm_ioremap_resource(dev, res);
if (IS_ERR(port->base))
return PTR_ERR(port->base);

res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (!res)
Expand Down

0 comments on commit c8690d6

Please sign in to comment.