diff mbox

[1/5] gpio: pxa: remove dead code

Message ID 1373555877-29887-2-git-send-email-zonque@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Mack July 11, 2013, 3:17 p.m. UTC
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(-)

Comments

Linus Walleij July 21, 2013, 4:15 p.m. UTC | #1
On Thu, Jul 11, 2013 at 5:17 PM, Daniel Mack <zonque@gmail.com> wrote:

> 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>

Tentatively applied, Haojian, does this look allright?

Yours,
Linus Walleij
Haojian Zhuang July 22, 2013, 7:14 a.m. UTC | #2
On 22 July 2013 00:15, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Thu, Jul 11, 2013 at 5:17 PM, Daniel Mack <zonque@gmail.com> wrote:
>
>> 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>
>
> Tentatively applied, Haojian, does this look allright?
>
> Yours,
> Linus Walleij

This patch is good.

Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Daniel Mack July 25, 2013, 9 a.m. UTC | #3
On 22.07.2013 09:14, Haojian Zhuang wrote:
> On 22 July 2013 00:15, Linus Walleij <linus.walleij@linaro.org> wrote:
>> On Thu, Jul 11, 2013 at 5:17 PM, Daniel Mack <zonque@gmail.com> wrote:
>>
>>> 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>
>>
>> Tentatively applied, Haojian, does this look allright?
>>
>> Yours,
>> Linus Walleij
> 
> This patch is good.
> 
> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
> 

And what about the others? I think the first 3 patches of this series
can go through Linus W, and the other 2 should end up in the pxa tree,
right?


Thanks,
Daniel
Linus Walleij July 25, 2013, 9:30 a.m. UTC | #4
On Thu, Jul 25, 2013 at 11:00 AM, Daniel Mack <zonque@gmail.com> wrote:

> And what about the others? I think the first 3 patches of this series
> can go through Linus W, and the other 2 should end up in the pxa tree,
> right?

Yes. They might need to build on top of the pinctrl tree.

Or, if there are no other things happening in the PXA tree for the
next merge window, I can take it into my tree, with the ACKs of
e.g. Eric and Olof Johansson.

Yours,
Linus Walleij
Daniel Mack July 27, 2013, 2:02 p.m. UTC | #5
Haojian Zhuang <haojian.zhuang@linaro.org> wrote:
>On 25 July 2013 17:30, Linus Walleij <linus.walleij@linaro.org> wrote:
>
>> On Thu, Jul 25, 2013 at 11:00 AM, Daniel Mack <zonque@gmail.com>
>wrote:
>>
>> > And what about the others? I think the first 3 patches of this
>series
>> > can go through Linus W, and the other 2 should end up in the pxa
>tree,
>> > right?
>>
>> Yes. They might need to build on top of the pinctrl tree.
>>
>> Or, if there are no other things happening in the PXA tree for the
>> next merge window, I can take it into my tree, with the ACKs of
>> e.g. Eric and Olof Johansson.
>>
>> Yours,
>> Linus Walleij
>>
>
>It's OK to merge all patches into gpio git tree.

No, wait. I have some more patches coming soon, and they will cause conflicts then in the merge window. So please take the last two ones into the pxa repo, and only the gpio specific one through Linus W.


Thanks,
Daniel

>Acked-by: Haojian Zhuang <haojian.zhuang@linaro.org>
diff mbox

Patch

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,