diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2015-09-30 23:51:08 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-10-05 09:14:44 +0200 |
commit | 43960b4731d3450fe82105c40ee19d487622e427 (patch) | |
tree | 366679923b9b064d6f585ed22c8dd85dd694e77b /drivers/gpio | |
parent | cf3f2a2c8bae0db72233629c9da9d9f617b3f8af (diff) | |
download | blackbird-obmc-linux-43960b4731d3450fe82105c40ee19d487622e427.tar.gz blackbird-obmc-linux-43960b4731d3450fe82105c40ee19d487622e427.zip |
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>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-generic.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c index eefff1a29986..0cdbe104e567 100644 --- a/drivers/gpio/gpio-generic.c +++ b/drivers/gpio/gpio-generic.c @@ -582,9 +582,7 @@ static void __iomem *bgpio_map(struct platform_device *pdev, resource_size_t sane_sz, int *err) { - struct device *dev = &pdev->dev; struct resource *r; - resource_size_t start; resource_size_t sz; void __iomem *ret; @@ -602,15 +600,9 @@ static void __iomem *bgpio_map(struct platform_device *pdev, return NULL; } - start = r->start; - if (!devm_request_mem_region(dev, start, sz, r->name)) { - *err = -EBUSY; - return NULL; - } - - ret = devm_ioremap(dev, start, sz); - if (!ret) { - *err = -ENOMEM; + ret = devm_ioremap_resource(&pdev->dev, r); + if (IS_ERR(ret)) { + *err = PTR_ERR(ret); return NULL; } |