]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
gpio: xgene: use devm_platform_ioremap_resource()
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 2 Oct 2019 16:31:10 +0000 (18:31 +0200)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 9 Oct 2019 16:19:55 +0000 (18:19 +0200)
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>
drivers/gpio/gpio-xgene.c

index 900b38a7dba8a2fc31b34d9b7e7f03938dde3bf1..a6e66ac18e1f79165a6da5e6f511eb5848785350 100644 (file)
@@ -155,7 +155,6 @@ static SIMPLE_DEV_PM_OPS(xgene_gpio_pm, xgene_gpio_suspend, xgene_gpio_resume);
 
 static int xgene_gpio_probe(struct platform_device *pdev)
 {
-       struct resource *res;
        struct xgene_gpio *gpio;
        int err = 0;
 
@@ -163,14 +162,9 @@ static int xgene_gpio_probe(struct platform_device *pdev)
        if (!gpio)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res)
-               return -EINVAL;
-
-       gpio->base = devm_ioremap_nocache(&pdev->dev, res->start,
-                                                       resource_size(res));
-       if (!gpio->base)
-               return -ENOMEM;
+       gpio->base = devm_platform_ioremap_resource(pdev, 0);
+       if (IS_ERR(gpio->base))
+               return PTR_ERR(gpio->base);
 
        gpio->chip.ngpio = XGENE_MAX_GPIOS;