diff options
author | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2019-10-02 18:41:10 +0200 |
---|---|---|
committer | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2019-10-09 18:20:19 +0200 |
commit | 71b4da2b370bb2b0f3391d24049417e9be0281a0 (patch) | |
tree | b5fcc488d99e5e95d3d9513d4a5dbf06ca34d587 /drivers/gpio/gpio-ath79.c | |
parent | gpio: em: use devm_platform_ioremap_resource() (diff) | |
download | linux-71b4da2b370bb2b0f3391d24049417e9be0281a0.tar.xz linux-71b4da2b370bb2b0f3391d24049417e9be0281a0.zip |
gpio: ath79: use devm_platform_ioremap_resource()
There's no need to use the nocache variant of ioremap(). Switch to
using devm_platform_ioremap_resource().
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-ath79.c')
-rw-r--r-- | drivers/gpio/gpio-ath79.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c index f1a5ea9b3de2..53fae02c40ad 100644 --- a/drivers/gpio/gpio-ath79.c +++ b/drivers/gpio/gpio-ath79.c @@ -226,7 +226,6 @@ static int ath79_gpio_probe(struct platform_device *pdev) struct device_node *np = dev->of_node; struct ath79_gpio_ctrl *ctrl; struct gpio_irq_chip *girq; - struct resource *res; u32 ath79_gpio_count; bool oe_inverted; int err; @@ -256,12 +255,9 @@ static int ath79_gpio_probe(struct platform_device *pdev) return -EINVAL; } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -EINVAL; - ctrl->base = devm_ioremap_nocache(dev, res->start, resource_size(res)); - if (!ctrl->base) - return -ENOMEM; + ctrl->base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(ctrl->base)) + return PTR_ERR(ctrl->base); raw_spin_lock_init(&ctrl->lock); err = bgpio_init(&ctrl->gc, dev, 4, |