linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: zonque@gmail.com (Daniel Mack)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/5] gpio: pxa: remove dead code
Date: Thu, 11 Jul 2013 17:17:53 +0200	[thread overview]
Message-ID: <1373555877-29887-2-git-send-email-zonque@gmail.com> (raw)
In-Reply-To: <1373555877-29887-1-git-send-email-zonque@gmail.com>

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>
---
 drivers/gpio/gpio-pxa.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index df2199d..cc13d1b 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 = {
 
 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,
-- 
1.8.1.4

  reply	other threads:[~2013-07-11 15:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-11 15:17 [PATCH 0/5] Assorted patches for pxa-gpio Daniel Mack
2013-07-11 15:17 ` Daniel Mack [this message]
2013-07-21 16:15   ` [PATCH 1/5] gpio: pxa: remove dead code Linus Walleij
2013-07-22  7:14     ` Haojian Zhuang
2013-07-25  9:00       ` Daniel Mack
2013-07-25  9:30         ` Linus Walleij
     [not found]           ` <CAD6h2NRBsRZkeZnQfko0inQ=QKurqibNSq_ZnuipU5MtZW3h=Q@mail.gmail.com>
2013-07-27 14:02             ` Daniel Mack
2013-07-11 15:17 ` [PATCH 2/5] gpio: pxa: fix Documentation of interrupt-names property Daniel Mack
2013-07-21 16:16   ` Linus Walleij
2013-07-11 15:17 ` [PATCH 3/5] gpio: pxa: Documentation: provide example bindings for PXA3xx Daniel Mack
2013-08-04 14:11   ` Haojian Zhuang
2013-08-04 14:13     ` Daniel Mack
2013-07-11 15:17 ` [PATCH 4/5] ARM: pxa: fix DT auxdata for pxa3xx-gpio Daniel Mack
2013-08-11  9:51   ` Haojian Zhuang
2013-07-11 15:17 ` [PATCH 5/5] ARM: pxa: DTS: override gpio node in pxa3xx.dtsi Daniel Mack
2013-08-11  9:51   ` Haojian Zhuang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1373555877-29887-2-git-send-email-zonque@gmail.com \
    --to=zonque@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).