linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next v2] pinctrl: samsung: fix build error without CONFIG_OF_GPIO
@ 2019-12-12  9:27 Chen Zhou
  2019-12-12  9:38 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 3+ messages in thread
From: Chen Zhou @ 2019-12-12  9:27 UTC (permalink / raw)
  To: tomasz.figa, krzk, s.nawrocki
  Cc: linux-gpio, linux-kernel, chenzhou10, Hulk Robot

If CONFIG_OF_GPIO is n, build fails:

drivers/pinctrl/samsung/pinctrl-samsung.c: In function samsung_gpiolib_register:
drivers/pinctrl/samsung/pinctrl-samsung.c:969:5: error: struct gpio_chip has no member named of_node
   gc->of_node = bank->of_node;

Use #ifdef to guard this.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
---
 drivers/pinctrl/samsung/pinctrl-samsung.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c
index f26574e..5c29ad8 100644
--- a/drivers/pinctrl/samsung/pinctrl-samsung.c
+++ b/drivers/pinctrl/samsung/pinctrl-samsung.c
@@ -966,7 +966,9 @@ static int samsung_gpiolib_register(struct platform_device *pdev,
 		gc->base = bank->grange.base;
 		gc->ngpio = bank->nr_pins;
 		gc->parent = &pdev->dev;
+#ifdef CONFIG_OF_GPIO
 		gc->of_node = bank->of_node;
+#endif
 		gc->label = bank->name;
 
 		ret = devm_gpiochip_add_data(&pdev->dev, gc, bank);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next v2] pinctrl: samsung: fix build error without CONFIG_OF_GPIO
  2019-12-12  9:27 [PATCH -next v2] pinctrl: samsung: fix build error without CONFIG_OF_GPIO Chen Zhou
@ 2019-12-12  9:38 ` Krzysztof Kozlowski
  2019-12-12  9:44   ` Krzysztof Kozlowski
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2019-12-12  9:38 UTC (permalink / raw)
  To: Chen Zhou; +Cc: Tomasz Figa, s.nawrocki, linux-gpio, linux-kernel, Hulk Robot

On Thu, 12 Dec 2019 at 10:30, Chen Zhou <chenzhou10@huawei.com> wrote:
>
> If CONFIG_OF_GPIO is n, build fails:
>
> drivers/pinctrl/samsung/pinctrl-samsung.c: In function samsung_gpiolib_register:
> drivers/pinctrl/samsung/pinctrl-samsung.c:969:5: error: struct gpio_chip has no member named of_node
>    gc->of_node = bank->of_node;
>
> Use #ifdef to guard this.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
> ---
>  drivers/pinctrl/samsung/pinctrl-samsung.c | 2 ++
>  1 file changed, 2 insertions(+)

I was thinking about adding OF_GPIO but I could not trigger such case
as you mention. How can I reproduce this?

Anyway, the select/dependencies in Kconfig should be fixed up -
PINCTRL_SAMSUNG should depend on OF and GPIOLIB.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next v2] pinctrl: samsung: fix build error without CONFIG_OF_GPIO
  2019-12-12  9:38 ` Krzysztof Kozlowski
@ 2019-12-12  9:44   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2019-12-12  9:44 UTC (permalink / raw)
  To: Chen Zhou; +Cc: Tomasz Figa, s.nawrocki, linux-gpio, linux-kernel, Hulk Robot

On Thu, 12 Dec 2019 at 10:38, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On Thu, 12 Dec 2019 at 10:30, Chen Zhou <chenzhou10@huawei.com> wrote:
> >
> > If CONFIG_OF_GPIO is n, build fails:
> >
> > drivers/pinctrl/samsung/pinctrl-samsung.c: In function samsung_gpiolib_register:
> > drivers/pinctrl/samsung/pinctrl-samsung.c:969:5: error: struct gpio_chip has no member named of_node
> >    gc->of_node = bank->of_node;
> >
> > Use #ifdef to guard this.
> >
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
> > ---
> >  drivers/pinctrl/samsung/pinctrl-samsung.c | 2 ++
> >  1 file changed, 2 insertions(+)
>
> I was thinking about adding OF_GPIO but I could not trigger such case
> as you mention. How can I reproduce this?

OK, I reproduced it with x86_64 + COMPILE_TEST + PINCTRL_S3C64XX. I'll
fix it up with proper dependencies on OF and GPIOLIB. The driver
should not have unnecessary ifdefs.

Thanks for the report!

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-12  9:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-12  9:27 [PATCH -next v2] pinctrl: samsung: fix build error without CONFIG_OF_GPIO Chen Zhou
2019-12-12  9:38 ` Krzysztof Kozlowski
2019-12-12  9:44   ` Krzysztof Kozlowski

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