Commit f63516f4 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski
Browse files

gpio: xgene: 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: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent cf62b4e4
Loading
Loading
Loading
Loading
+3 −9
Original line number Original line Diff line number Diff line
@@ -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)
static int xgene_gpio_probe(struct platform_device *pdev)
{
{
	struct resource *res;
	struct xgene_gpio *gpio;
	struct xgene_gpio *gpio;
	int err = 0;
	int err = 0;


@@ -163,14 +162,9 @@ static int xgene_gpio_probe(struct platform_device *pdev)
	if (!gpio)
	if (!gpio)
		return -ENOMEM;
		return -ENOMEM;


	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	gpio->base = devm_platform_ioremap_resource(pdev, 0);
	if (!res)
	if (IS_ERR(gpio->base))
		return -EINVAL;
		return PTR_ERR(gpio->base);

	gpio->base = devm_ioremap_nocache(&pdev->dev, res->start,
							resource_size(res));
	if (!gpio->base)
		return -ENOMEM;


	gpio->chip.ngpio = XGENE_MAX_GPIOS;
	gpio->chip.ngpio = XGENE_MAX_GPIOS;