Skip to content

Commit 43960b4

Browse files
hkallweitLinus Walleij
authored andcommitted
gpio: generic: modernize remapping
Replace devm_request_mem_region / devm_ioremap with devm_ioremap_resource. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent cf3f2a2 commit 43960b4

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

drivers/gpio/gpio-generic.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,7 @@ static void __iomem *bgpio_map(struct platform_device *pdev,
582582
resource_size_t sane_sz,
583583
int *err)
584584
{
585-
struct device *dev = &pdev->dev;
586585
struct resource *r;
587-
resource_size_t start;
588586
resource_size_t sz;
589587
void __iomem *ret;
590588

@@ -602,15 +600,9 @@ static void __iomem *bgpio_map(struct platform_device *pdev,
602600
return NULL;
603601
}
604602

605-
start = r->start;
606-
if (!devm_request_mem_region(dev, start, sz, r->name)) {
607-
*err = -EBUSY;
608-
return NULL;
609-
}
610-
611-
ret = devm_ioremap(dev, start, sz);
612-
if (!ret) {
613-
*err = -ENOMEM;
603+
ret = devm_ioremap_resource(&pdev->dev, r);
604+
if (IS_ERR(ret)) {
605+
*err = PTR_ERR(ret);
614606
return NULL;
615607
}
616608

0 commit comments

Comments
 (0)