]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
gpio: pxa: remove dead code
authorDaniel Mack <zonque@gmail.com>
Thu, 11 Jul 2013 15:17:53 +0000 (17:17 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Sun, 21 Jul 2013 16:14:20 +0000 (18:14 +0200)
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>
drivers/gpio/gpio-pxa.c

index df2199dd149975e37a31efc6a881450a6ad6af12..cc13d1b74fad09f06c0d2bd42cc4d41b196df2cf 100644 (file)
@@ -524,8 +524,8 @@ const struct irq_domain_ops pxa_irq_domain_ops = {
 
 static int pxa_gpio_probe_dt(struct platform_device *pdev)
 {
-       int ret, nr_gpios;
-       struct device_node *prev, *next, *np = pdev->dev.of_node;
+       int ret = 0, nr_gpios;
+       struct device_node *np = pdev->dev.of_node;
        const struct of_device_id *of_id =
                                of_match_device(pxa_gpio_dt_ids, &pdev->dev);
        const struct pxa_gpio_id *gpio_id;
@@ -537,20 +537,13 @@ static int pxa_gpio_probe_dt(struct platform_device *pdev)
        gpio_id = of_id->data;
        gpio_type = gpio_id->type;
 
-       next = of_get_next_child(np, NULL);
-       prev = next;
-       if (!next) {
-               dev_err(&pdev->dev, "Failed to find child gpio node\n");
-               ret = -EINVAL;
-               goto err;
-       }
-       of_node_put(prev);
        nr_gpios = gpio_id->gpio_nums;
        pxa_last_gpio = nr_gpios - 1;
 
        irq_base = irq_alloc_descs(-1, 0, nr_gpios, 0);
        if (irq_base < 0) {
                dev_err(&pdev->dev, "Failed to allocate IRQ numbers\n");
+               ret = irq_base;
                goto err;
        }
        domain = irq_domain_add_legacy(np, nr_gpios, irq_base, 0,