Commit 94bfcbf0 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski

gpio: em: 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>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
parent f63516f4
...@@ -269,7 +269,7 @@ static void em_gio_irq_domain_remove(void *data) ...@@ -269,7 +269,7 @@ static void em_gio_irq_domain_remove(void *data)
static int em_gio_probe(struct platform_device *pdev) static int em_gio_probe(struct platform_device *pdev)
{ {
struct em_gio_priv *p; struct em_gio_priv *p;
struct resource *io[2], *irq[2]; struct resource *irq[2];
struct gpio_chip *gpio_chip; struct gpio_chip *gpio_chip;
struct irq_chip *irq_chip; struct irq_chip *irq_chip;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
...@@ -285,25 +285,21 @@ static int em_gio_probe(struct platform_device *pdev) ...@@ -285,25 +285,21 @@ static int em_gio_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, p); platform_set_drvdata(pdev, p);
spin_lock_init(&p->sense_lock); spin_lock_init(&p->sense_lock);
io[0] = platform_get_resource(pdev, IORESOURCE_MEM, 0);
io[1] = platform_get_resource(pdev, IORESOURCE_MEM, 1);
irq[0] = platform_get_resource(pdev, IORESOURCE_IRQ, 0); irq[0] = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
irq[1] = platform_get_resource(pdev, IORESOURCE_IRQ, 1); irq[1] = platform_get_resource(pdev, IORESOURCE_IRQ, 1);
if (!io[0] || !io[1] || !irq[0] || !irq[1]) { if (!irq[0] || !irq[1]) {
dev_err(dev, "missing IRQ or IOMEM\n"); dev_err(dev, "missing IRQ or IOMEM\n");
return -EINVAL; return -EINVAL;
} }
p->base0 = devm_ioremap_nocache(dev, io[0]->start, p->base0 = devm_platform_ioremap_resource(pdev, 0);
resource_size(io[0])); if (IS_ERR(p->base0))
if (!p->base0) return PTR_ERR(p->base0);
return -ENOMEM;
p->base1 = devm_ioremap_nocache(dev, io[1]->start, p->base1 = devm_platform_ioremap_resource(pdev, 1);
resource_size(io[1])); if (IS_ERR(p->base1))
if (!p->base1) return PTR_ERR(p->base1);
return -ENOMEM;
if (of_property_read_u32(dev->of_node, "ngpios", &ngpios)) { if (of_property_read_u32(dev->of_node, "ngpios", &ngpios)) {
dev_err(dev, "Missing ngpios OF property\n"); dev_err(dev, "Missing ngpios OF property\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment