[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190829143742.24726-9-brgl@bgdev.pl>
Date: Thu, 29 Aug 2019 16:37:41 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Jonathan Corbet <corbet@....net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Alban Bedel <albeu@...e.fr>,
Linus Walleij <linus.walleij@...aro.org>,
Arnd Bergmann <arnd@...db.de>,
Geert Uytterhoeven <geert+renesas@...der.be>
Cc: linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-gpio@...r.kernel.org, Julia Lawall <Julia.Lawall@...6.fr>,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: [PATCH 8/9] gpio: xgene: use devm_platform_ioremap_resource_nocache()
From: Bartosz Golaszewski <bgolaszewski@...libre.com>
Use the new devm_platform_ioremap_resource_nocache() helper for memory
range mapping instead of devm_ioremap_nocache() combined with a call to
platform_get_resource().
Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
---
drivers/gpio/gpio-xgene.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c
index 2918363884de..559b8e53c2e0 100644
--- a/drivers/gpio/gpio-xgene.c
+++ b/drivers/gpio/gpio-xgene.c
@@ -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;
@@ -165,16 +164,9 @@ static int xgene_gpio_probe(struct platform_device *pdev)
goto err;
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- err = -EINVAL;
- goto err;
- }
-
- gpio->base = devm_ioremap_nocache(&pdev->dev, res->start,
- resource_size(res));
- if (!gpio->base) {
- err = -ENOMEM;
+ gpio->base = devm_platform_ioremap_resource_nocache(pdev, 0);
+ if (IS_ERR(gpio->base)) {
+ err = PTR_ERR(gpio->base);
goto err;
}
--
2.21.0
Powered by blists - more mailing lists