Skip to contentSkip to conversation

linux-next: build failure after merge of the gpio tree

PATCH Stephen Rothwell 3 participants 8 messages Aug 12, 2015 – Aug 13, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Linus,

After merging the gpio tree, today's linux-next build (powerpc allyesconfig) failed like this:

drivers/extcon/extcon-palmas.c:211:25: error: too few arguments to function 'devm_gpiod_get_optional'

  palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id");
                         ^

In file included from /home/sfr/next/next/include/asm-generic/gpio.h:13:0,
from /home/sfr/next/next/include/linux/gpio.h:51, from /home/sfr/next/next/include/linux/of_gpio.h:20, from /home/sfr/next/next/include/linux/mfd/palmas.h:24, from /home/sfr/next/next/drivers/extcon/extcon-palmas.c:28:
/home/sfr/next/next/include/linux/gpio/consumer.h:80:32: note: declared here
struct gpio_desc *__must_check devm_gpiod_get_optional(struct device *dev,

                                ^

Caused by commit

b17d1bf16cc7 ("gpio: make flags mandatory for gpiod_get functions")

interacting with commit

92b7cb5dc885 ("extcon: palmas: Support GPIO based USB ID detection")

from the extcon tree.

I have applied this merge fix patch for today:

From: Stephen Rothwell <[email protected]>
Date: Wed, 12 Aug 2015 18:05:55 +1000
Subject: [PATCH] extcon: palmas: fix for devm_gpiod_get_optional API change

---
 drivers/extcon/extcon-palmas.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/extcon/extcon-palmas.c +1 -1
index 662e91778cb0..4ce4106b8f4f 100644
@@ -208,7 +208,7 @@ static int palmas_usb_probe(struct platform_device *pdev)
 			palmas_usb->wakeup = pdata->wakeup;
 	}
 
-	palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id");
+	palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id", GPIOD_ASIS);
 	if (IS_ERR(palmas_usb->id_gpiod)) {
 		dev_err(&pdev->dev, "failed to get id gpio\n");
 		return PTR_ERR(palmas_usb->id_gpiod);
Signature · 5 lines
2.5.0

-- 
Cheers,
Stephen Rothwell                    [email protected]
#1 lore raw

Hello Stephen,

Quoted 15 lines · Stephen Rothwell

After merging the gpio tree, today's linux-next build (powerpc allyesconfig) failed like this:

drivers/extcon/extcon-palmas.c:211:25: error: too few arguments to function 'devm_gpiod_get_optional'

  palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id");
                         ^

In file included from /home/sfr/next/next/include/asm-generic/gpio.h:13:0,
from /home/sfr/next/next/include/linux/gpio.h:51, from /home/sfr/next/next/include/linux/of_gpio.h:20, from /home/sfr/next/next/include/linux/mfd/palmas.h:24, from /home/sfr/next/next/drivers/extcon/extcon-palmas.c:28:
/home/sfr/next/next/include/linux/gpio/consumer.h:80:32: note: declared here
struct gpio_desc *__must_check devm_gpiod_get_optional(struct device *dev,

                                ^
Quoted 7 lines

Caused by commit

b17d1bf16cc7 ("gpio: make flags mandatory for gpiod_get functions")

interacting with commit

92b7cb5dc885 ("extcon: palmas: Support GPIO based USB ID detection")

I don't find this commit, can you tell me though which tree this comes into next?

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#2 lore raw

Hi Uwe,

Quoted 19 lines · On Wed, 12 Aug 2015 10:21:07 +0200 Uwe Kleine-König…
Quoted 17 lines · Stephen Rothwell

After merging the gpio tree, today's linux-next build (powerpc allyesconfig) failed like this:

drivers/extcon/extcon-palmas.c:211:25: error: too few arguments to function 'devm_gpiod_get_optional'

  palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id");
                         ^

In file included from /home/sfr/next/next/include/asm-generic/gpio.h:13:0,
from /home/sfr/next/next/include/linux/gpio.h:51, from /home/sfr/next/next/include/linux/of_gpio.h:20, from /home/sfr/next/next/include/linux/mfd/palmas.h:24, from /home/sfr/next/next/drivers/extcon/extcon-palmas.c:28:
/home/sfr/next/next/include/linux/gpio/consumer.h:80:32: note: declared here
struct gpio_desc *__must_check devm_gpiod_get_optional(struct device *dev,

                                ^

Caused by commit

Quoted 8 lines
Quoted 5 lines

b17d1bf16cc7 ("gpio: make flags mandatory for gpiod_get functions")

interacting with commit

92b7cb5dc885 ("extcon: palmas: Support GPIO based USB ID detection")

I don't find this commit, can you tell me though which tree this comes into next?

Umm, the next line of that email said:

"from the extcon tree."

:-)

That would be

git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git#extcon-next

run by Chanwoo Choi.

Signature · 2 lines
Cheers,
Stephen Rothwell                    [email protected]
#3 lore raw

Hi Uwe,

Quoted 34 lines · On Wed, 12 Aug 2015 22:27:58 +1000 Stephen Rothwell <[email protected]>…
Quoted 19 lines · On Wed, 12 Aug 2015 10:21:07 +0200 Uwe Kleine-König…
Quoted 17 lines · Stephen Rothwell

After merging the gpio tree, today's linux-next build (powerpc allyesconfig) failed like this:

drivers/extcon/extcon-palmas.c:211:25: error: too few arguments to function 'devm_gpiod_get_optional'

  palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id");
                         ^

In file included from /home/sfr/next/next/include/asm-generic/gpio.h:13:0,
from /home/sfr/next/next/include/linux/gpio.h:51, from /home/sfr/next/next/include/linux/of_gpio.h:20, from /home/sfr/next/next/include/linux/mfd/palmas.h:24, from /home/sfr/next/next/drivers/extcon/extcon-palmas.c:28:
/home/sfr/next/next/include/linux/gpio/consumer.h:80:32: note: declared here
struct gpio_desc *__must_check devm_gpiod_get_optional(struct device *dev,

                                ^

Caused by commit

Quoted 8 lines
Quoted 5 lines

b17d1bf16cc7 ("gpio: make flags mandatory for gpiod_get functions")

interacting with commit

92b7cb5dc885 ("extcon: palmas: Support GPIO based USB ID detection")

I don't find this commit, can you tell me though which tree this comes into next?

Umm, the next line of that email said:

"from the extcon tree."

Quoted 7 lines

:-)

That would be

git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git#extcon-next

run by Chanwoo Choi.

Sorry about that, but I hadn't pushed the linux-tree out yet ...

Signature · 2 lines
Cheers,
Stephen Rothwell                    [email protected]
#4 lore raw
In reply to Stephen Rothwell

Hello,

Quoted 15 lines · Stephen Rothwell

After merging the gpio tree, today's linux-next build (powerpc allyesconfig) failed like this:

drivers/extcon/extcon-palmas.c:211:25: error: too few arguments to function 'devm_gpiod_get_optional'

  palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id");
                         ^

In file included from /home/sfr/next/next/include/asm-generic/gpio.h:13:0,
from /home/sfr/next/next/include/linux/gpio.h:51, from /home/sfr/next/next/include/linux/of_gpio.h:20, from /home/sfr/next/next/include/linux/mfd/palmas.h:24, from /home/sfr/next/next/drivers/extcon/extcon-palmas.c:28:
/home/sfr/next/next/include/linux/gpio/consumer.h:80:32: note: declared here
struct gpio_desc *__must_check devm_gpiod_get_optional(struct device *dev,

                                ^
Quoted 7 lines

Caused by commit

b17d1bf16cc7 ("gpio: make flags mandatory for gpiod_get functions")

interacting with commit

92b7cb5dc885 ("extcon: palmas: Support GPIO based USB ID detection")

that commit is not correct. After

	palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id");

it does

	palmas_usb->gpio_id_irq = gpiod_to_irq(palmas_usb->id_gpiod);

without setting the gpio to input. So the right fix is not to add GPIOD_ASIS but GPIOD_IN.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#5 lore raw

Hi Uwe,

Quoted 26 lines · On Wed, 12 Aug 2015 22:16:42 +0200 Uwe Kleine-König…
Quoted 15 lines · Stephen Rothwell

After merging the gpio tree, today's linux-next build (powerpc allyesconfig) failed like this:

drivers/extcon/extcon-palmas.c:211:25: error: too few arguments to function 'devm_gpiod_get_optional'

  palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id");
                         ^

In file included from /home/sfr/next/next/include/asm-generic/gpio.h:13:0,
from /home/sfr/next/next/include/linux/gpio.h:51, from /home/sfr/next/next/include/linux/of_gpio.h:20, from /home/sfr/next/next/include/linux/mfd/palmas.h:24, from /home/sfr/next/next/drivers/extcon/extcon-palmas.c:28:
/home/sfr/next/next/include/linux/gpio/consumer.h:80:32: note: declared here
struct gpio_desc *__must_check devm_gpiod_get_optional(struct device *dev,

                                ^
Quoted 7 lines

Caused by commit

b17d1bf16cc7 ("gpio: make flags mandatory for gpiod_get functions")

interacting with commit

92b7cb5dc885 ("extcon: palmas: Support GPIO based USB ID detection")

that commit is not correct. After

Quoted 8 lines
	palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id");

it does

	palmas_usb->gpio_id_irq = gpiod_to_irq(palmas_usb->id_gpiod);

without setting the gpio to input. So the right fix is not to add GPIOD_ASIS but GPIOD_IN.

OK, I have fixed my merge fix patch, but can you submit a correct patch to the extcon tree maintainer, please? I assume it can be fixed in that tree right now, right?

Signature · 2 lines
Cheers,
Stephen Rothwell                    [email protected]
maintainer
#6 lore raw

Hi Stephen,

Quoted 33 lines · Stephen Rothwell

Hi Uwe,

Quoted 30 lines · On Wed, 12 Aug 2015 22:16:42 +0200 Uwe Kleine-König…
Quoted 15 lines · Stephen Rothwell

After merging the gpio tree, today's linux-next build (powerpc allyesconfig) failed like this:

drivers/extcon/extcon-palmas.c:211:25: error: too few arguments to function 'devm_gpiod_get_optional'

  palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id");
                         ^

In file included from /home/sfr/next/next/include/asm-generic/gpio.h:13:0,
from /home/sfr/next/next/include/linux/gpio.h:51, from /home/sfr/next/next/include/linux/of_gpio.h:20, from /home/sfr/next/next/include/linux/mfd/palmas.h:24, from /home/sfr/next/next/drivers/extcon/extcon-palmas.c:28:
/home/sfr/next/next/include/linux/gpio/consumer.h:80:32: note: declared here
struct gpio_desc *__must_check devm_gpiod_get_optional(struct device *dev,

                                ^
Quoted 7 lines

Caused by commit

b17d1bf16cc7 ("gpio: make flags mandatory for gpiod_get functions")

interacting with commit

92b7cb5dc885 ("extcon: palmas: Support GPIO based USB ID detection")

that commit is not correct. After

	palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id");

it does

Quoted 9 lines
Quoted 4 lines
	palmas_usb->gpio_id_irq = gpiod_to_irq(palmas_usb->id_gpiod);

without setting the gpio to input. So the right fix is not to add GPIOD_ASIS but GPIOD_IN.

OK, I have fixed my merge fix patch, but can you submit a correct patch to the extcon tree maintainer, please? I assume it can be fixed in that tree right now, right?

I'll fix it as Uwe comment as following:

drivers/extcon/extcon-palmas.c +2 -1
@@ -208,7 +208,8 @@ static int palmas_usb_probe(struct platform_device *pdev)
                        palmas_usb->wakeup = pdata->wakeup;
        }
 
-       palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id");
+       palmas_usb->id_gpiod =
+               devm_gpiod_get_optional(&pdev->dev, "id", GPIOD_IN);
        if (IS_ERR(palmas_usb->id_gpiod)) {
                dev_err(&pdev->dev, "failed to get id gpio\n");
                return PTR_ERR(palmas_usb->id_gpiod);

I'll send it to LKML and apply it on extcon-next tree.

Thanks,
Chanwoo Choi

#7 lore raw

Hi Chanwoo,

Quoted 62 lines · On Thu, 13 Aug 2015 09:19:12 +0900 Chanwoo Choi <[email protected]> wrote:

Hi Stephen,

Quoted 33 lines · Stephen Rothwell

Hi Uwe,

Quoted 30 lines · On Wed, 12 Aug 2015 22:16:42 +0200 Uwe Kleine-König…
Quoted 15 lines · Stephen Rothwell

After merging the gpio tree, today's linux-next build (powerpc allyesconfig) failed like this:

drivers/extcon/extcon-palmas.c:211:25: error: too few arguments to function 'devm_gpiod_get_optional'

  palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id");
                         ^

In file included from /home/sfr/next/next/include/asm-generic/gpio.h:13:0,
from /home/sfr/next/next/include/linux/gpio.h:51, from /home/sfr/next/next/include/linux/of_gpio.h:20, from /home/sfr/next/next/include/linux/mfd/palmas.h:24, from /home/sfr/next/next/drivers/extcon/extcon-palmas.c:28:
/home/sfr/next/next/include/linux/gpio/consumer.h:80:32: note: declared here
struct gpio_desc *__must_check devm_gpiod_get_optional(struct device *dev,

                                ^
Quoted 7 lines

Caused by commit

b17d1bf16cc7 ("gpio: make flags mandatory for gpiod_get functions")

interacting with commit

92b7cb5dc885 ("extcon: palmas: Support GPIO based USB ID detection")

that commit is not correct. After

	palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id");

it does

Quoted 9 lines
Quoted 4 lines
	palmas_usb->gpio_id_irq = gpiod_to_irq(palmas_usb->id_gpiod);

without setting the gpio to input. So the right fix is not to add GPIOD_ASIS but GPIOD_IN.

OK, I have fixed my merge fix patch, but can you submit a correct patch to the extcon tree maintainer, please? I assume it can be fixed in that tree right now, right?

I'll fix it as Uwe comment as following:

drivers/extcon/extcon-palmas.c +2 -1
@@ -208,7 +208,8 @@ static int palmas_usb_probe(struct platform_device *pdev)
                        palmas_usb->wakeup = pdata->wakeup;
        }
 
-       palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id");
+       palmas_usb->id_gpiod =
+               devm_gpiod_get_optional(&pdev->dev, "id", GPIOD_IN);
        if (IS_ERR(palmas_usb->id_gpiod)) {
                dev_err(&pdev->dev, "failed to get id gpio\n");
                return PTR_ERR(palmas_usb->id_gpiod);
Quoted 1 line

I'll send it to LKML and apply it on extcon-next tree.

Thanks.

Signature · 2 lines
Cheers,
Stephen Rothwell                    [email protected]