Commit 527b397a authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Walleij

gpio: em: Remove obsolete platform data support

Since commit 59032702 ("ARM: shmobile: Remove legacy platform
devices from EMEV2 SoC code"), EMMA Mobile SoCs are only supported in
generic DT-only ARM multi-platform builds.  The driver doesn't need to
use platform data anymore, hence remove platform data configuration.
Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Acked-by: default avatarSimon Horman <horms+renesas@verge.net.au>
Tested-by: default avatarNiklas Söderlund <niso@kth.se>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent e7aa6d8c
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/pinctrl/consumer.h> #include <linux/pinctrl/consumer.h>
#include <linux/platform_data/gpio-em.h>
struct em_gio_priv { struct em_gio_priv {
void __iomem *base0; void __iomem *base0;
...@@ -273,13 +272,12 @@ static const struct irq_domain_ops em_gio_irq_domain_ops = { ...@@ -273,13 +272,12 @@ static const struct irq_domain_ops em_gio_irq_domain_ops = {
static int em_gio_probe(struct platform_device *pdev) static int em_gio_probe(struct platform_device *pdev)
{ {
struct gpio_em_config pdata_dt;
struct gpio_em_config *pdata = dev_get_platdata(&pdev->dev);
struct em_gio_priv *p; struct em_gio_priv *p;
struct resource *io[2], *irq[2]; struct resource *io[2], *irq[2];
struct gpio_chip *gpio_chip; struct gpio_chip *gpio_chip;
struct irq_chip *irq_chip; struct irq_chip *irq_chip;
const char *name = dev_name(&pdev->dev); const char *name = dev_name(&pdev->dev);
unsigned int ngpios;
int ret; int ret;
p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL); p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
...@@ -319,18 +317,10 @@ static int em_gio_probe(struct platform_device *pdev) ...@@ -319,18 +317,10 @@ static int em_gio_probe(struct platform_device *pdev)
goto err0; goto err0;
} }
if (!pdata) { if (of_property_read_u32(pdev->dev.of_node, "ngpios", &ngpios)) {
memset(&pdata_dt, 0, sizeof(pdata_dt)); dev_err(&pdev->dev, "Missing ngpios OF property\n");
pdata = &pdata_dt; ret = -EINVAL;
goto err0;
if (of_property_read_u32(pdev->dev.of_node, "ngpios",
&pdata->number_of_pins)) {
dev_err(&pdev->dev, "Missing ngpios OF property\n");
ret = -EINVAL;
goto err0;
}
pdata->gpio_base = -1;
} }
gpio_chip = &p->gpio_chip; gpio_chip = &p->gpio_chip;
...@@ -345,8 +335,8 @@ static int em_gio_probe(struct platform_device *pdev) ...@@ -345,8 +335,8 @@ static int em_gio_probe(struct platform_device *pdev)
gpio_chip->label = name; gpio_chip->label = name;
gpio_chip->dev = &pdev->dev; gpio_chip->dev = &pdev->dev;
gpio_chip->owner = THIS_MODULE; gpio_chip->owner = THIS_MODULE;
gpio_chip->base = pdata->gpio_base; gpio_chip->base = -1;
gpio_chip->ngpio = pdata->number_of_pins; gpio_chip->ngpio = ngpios;
irq_chip = &p->irq_chip; irq_chip = &p->irq_chip;
irq_chip->name = name; irq_chip->name = name;
...@@ -357,9 +347,7 @@ static int em_gio_probe(struct platform_device *pdev) ...@@ -357,9 +347,7 @@ static int em_gio_probe(struct platform_device *pdev)
irq_chip->irq_release_resources = em_gio_irq_relres; irq_chip->irq_release_resources = em_gio_irq_relres;
irq_chip->flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND; irq_chip->flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND;
p->irq_domain = irq_domain_add_simple(pdev->dev.of_node, p->irq_domain = irq_domain_add_simple(pdev->dev.of_node, ngpios, 0,
pdata->number_of_pins,
pdata->irq_base,
&em_gio_irq_domain_ops, p); &em_gio_irq_domain_ops, p);
if (!p->irq_domain) { if (!p->irq_domain) {
ret = -ENXIO; ret = -ENXIO;
...@@ -387,12 +375,6 @@ static int em_gio_probe(struct platform_device *pdev) ...@@ -387,12 +375,6 @@ static int em_gio_probe(struct platform_device *pdev)
goto err1; goto err1;
} }
if (pdata->pctl_name) {
ret = gpiochip_add_pin_range(gpio_chip, pdata->pctl_name, 0,
gpio_chip->base, gpio_chip->ngpio);
if (ret < 0)
dev_warn(&pdev->dev, "failed to add pin range\n");
}
return 0; return 0;
err1: err1:
......
#ifndef __GPIO_EM_H__
#define __GPIO_EM_H__
struct gpio_em_config {
unsigned int gpio_base;
unsigned int irq_base;
unsigned int number_of_pins;
const char *pctl_name;
};
#endif /* __GPIO_EM_H__ */
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