Skip to content

Commit 527b397

Browse files
geertulinusw
authored andcommitted
gpio: em: Remove obsolete platform data support
Since commit 5903270 ("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: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Simon Horman <horms+renesas@verge.net.au> Tested-by: Niklas Söderlund <niso@kth.se> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent e7aa6d8 commit 527b397

File tree

2 files changed

+8
-37
lines changed

2 files changed

+8
-37
lines changed

drivers/gpio/gpio-em.c

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include <linux/slab.h>
3232
#include <linux/module.h>
3333
#include <linux/pinctrl/consumer.h>
34-
#include <linux/platform_data/gpio-em.h>
3534

3635
struct em_gio_priv {
3736
void __iomem *base0;
@@ -273,13 +272,12 @@ static const struct irq_domain_ops em_gio_irq_domain_ops = {
273272

274273
static int em_gio_probe(struct platform_device *pdev)
275274
{
276-
struct gpio_em_config pdata_dt;
277-
struct gpio_em_config *pdata = dev_get_platdata(&pdev->dev);
278275
struct em_gio_priv *p;
279276
struct resource *io[2], *irq[2];
280277
struct gpio_chip *gpio_chip;
281278
struct irq_chip *irq_chip;
282279
const char *name = dev_name(&pdev->dev);
280+
unsigned int ngpios;
283281
int ret;
284282

285283
p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
@@ -319,18 +317,10 @@ static int em_gio_probe(struct platform_device *pdev)
319317
goto err0;
320318
}
321319

322-
if (!pdata) {
323-
memset(&pdata_dt, 0, sizeof(pdata_dt));
324-
pdata = &pdata_dt;
325-
326-
if (of_property_read_u32(pdev->dev.of_node, "ngpios",
327-
&pdata->number_of_pins)) {
328-
dev_err(&pdev->dev, "Missing ngpios OF property\n");
329-
ret = -EINVAL;
330-
goto err0;
331-
}
332-
333-
pdata->gpio_base = -1;
320+
if (of_property_read_u32(pdev->dev.of_node, "ngpios", &ngpios)) {
321+
dev_err(&pdev->dev, "Missing ngpios OF property\n");
322+
ret = -EINVAL;
323+
goto err0;
334324
}
335325

336326
gpio_chip = &p->gpio_chip;
@@ -345,8 +335,8 @@ static int em_gio_probe(struct platform_device *pdev)
345335
gpio_chip->label = name;
346336
gpio_chip->dev = &pdev->dev;
347337
gpio_chip->owner = THIS_MODULE;
348-
gpio_chip->base = pdata->gpio_base;
349-
gpio_chip->ngpio = pdata->number_of_pins;
338+
gpio_chip->base = -1;
339+
gpio_chip->ngpio = ngpios;
350340

351341
irq_chip = &p->irq_chip;
352342
irq_chip->name = name;
@@ -357,9 +347,7 @@ static int em_gio_probe(struct platform_device *pdev)
357347
irq_chip->irq_release_resources = em_gio_irq_relres;
358348
irq_chip->flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND;
359349

360-
p->irq_domain = irq_domain_add_simple(pdev->dev.of_node,
361-
pdata->number_of_pins,
362-
pdata->irq_base,
350+
p->irq_domain = irq_domain_add_simple(pdev->dev.of_node, ngpios, 0,
363351
&em_gio_irq_domain_ops, p);
364352
if (!p->irq_domain) {
365353
ret = -ENXIO;
@@ -387,12 +375,6 @@ static int em_gio_probe(struct platform_device *pdev)
387375
goto err1;
388376
}
389377

390-
if (pdata->pctl_name) {
391-
ret = gpiochip_add_pin_range(gpio_chip, pdata->pctl_name, 0,
392-
gpio_chip->base, gpio_chip->ngpio);
393-
if (ret < 0)
394-
dev_warn(&pdev->dev, "failed to add pin range\n");
395-
}
396378
return 0;
397379

398380
err1:

include/linux/platform_data/gpio-em.h

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)