aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2013-07-11 11:17:53 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-07-21 12:14:20 -0400
commit5dbb7c637f5adadc02c912fb5fc709ec1d342000 (patch)
treee8355ce9ed1f3b9299768f7249d281eb9c8a9d74 /drivers/gpio
parent640efa08cb635ae43d5ceae302b20c2c3f2035e5 (diff)
gpio: pxa: remove dead code
Commit f87311743 ("ARM: mmp: add more compatible names in gpio driver") changed the driver logic to determine the number of available GPIOs from the compatible string, and hence obsoleted the (undocumented) child nodes that were previously necessary. However, it left some remainder which can be safely removed now. Also, this patch makes pxa_gpio_probe_dt() return the correct value in case irq_alloc_descs() fails. Signed-off-by: Daniel Mack <zonque@gmail.com> Cc: Haojian Zhuang <haojian.zhuang@linaro.org> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-pxa.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index df2199dd1499..cc13d1b74fad 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -524,8 +524,8 @@ const struct irq_domain_ops pxa_irq_domain_ops = {
524 524
525static int pxa_gpio_probe_dt(struct platform_device *pdev) 525static int pxa_gpio_probe_dt(struct platform_device *pdev)
526{ 526{
527 int ret, nr_gpios; 527 int ret = 0, nr_gpios;
528 struct device_node *prev, *next, *np = pdev->dev.of_node; 528 struct device_node *np = pdev->dev.of_node;
529 const struct of_device_id *of_id = 529 const struct of_device_id *of_id =
530 of_match_device(pxa_gpio_dt_ids, &pdev->dev); 530 of_match_device(pxa_gpio_dt_ids, &pdev->dev);
531 const struct pxa_gpio_id *gpio_id; 531 const struct pxa_gpio_id *gpio_id;
@@ -537,20 +537,13 @@ static int pxa_gpio_probe_dt(struct platform_device *pdev)
537 gpio_id = of_id->data; 537 gpio_id = of_id->data;
538 gpio_type = gpio_id->type; 538 gpio_type = gpio_id->type;
539 539
540 next = of_get_next_child(np, NULL);
541 prev = next;
542 if (!next) {
543 dev_err(&pdev->dev, "Failed to find child gpio node\n");
544 ret = -EINVAL;
545 goto err;
546 }
547 of_node_put(prev);
548 nr_gpios = gpio_id->gpio_nums; 540 nr_gpios = gpio_id->gpio_nums;
549 pxa_last_gpio = nr_gpios - 1; 541 pxa_last_gpio = nr_gpios - 1;
550 542
551 irq_base = irq_alloc_descs(-1, 0, nr_gpios, 0); 543 irq_base = irq_alloc_descs(-1, 0, nr_gpios, 0);
552 if (irq_base < 0) { 544 if (irq_base < 0) {
553 dev_err(&pdev->dev, "Failed to allocate IRQ numbers\n"); 545 dev_err(&pdev->dev, "Failed to allocate IRQ numbers\n");
546 ret = irq_base;
554 goto err; 547 goto err;
555 } 548 }
556 domain = irq_domain_add_legacy(np, nr_gpios, irq_base, 0, 549 domain = irq_domain_add_legacy(np, nr_gpios, irq_base, 0,