linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/x86: pcengines-apu2 needs gpiolib
@ 2019-07-12  8:54 Arnd Bergmann
  2019-07-13 14:36 ` Enrico Weigelt, metux IT consult
  2019-07-14 16:41 ` Andy Shevchenko
  0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2019-07-12  8:54 UTC (permalink / raw)
  To: Darren Hart, Andy Shevchenko
  Cc: Arnd Bergmann, linux-gpio, linus.walleij, bgolaszewski,
	platform-driver-x86, Andy Shevchenko, Enrico Weigelt,
	metux IT consult, Randy Dunlap, Rafael J. Wysocki, linux-kernel

I ran into another build issue in randconfig testing for this driver,
when CONFIG_GPIOLIB is not set:

WARNING: unmet direct dependencies detected for GPIO_AMD_FCH
  Depends on [n]: GPIOLIB [=n] && HAS_IOMEM [=y]
  Selected by [y]:
  - PCENGINES_APU2 [=y] && X86 [=y] && X86_PLATFORM_DEVICES [=y] && INPUT [=y] && INPUT_KEYBOARD [=y] && LEDS_CLASS [=y]

WARNING: unmet direct dependencies detected for KEYBOARD_GPIO_POLLED
  Depends on [n]: !UML && INPUT [=y] && INPUT_KEYBOARD [=y] && GPIOLIB [=n]
  Selected by [y]:
  - PCENGINES_APU2 [=y] && X86 [=y] && X86_PLATFORM_DEVICES [=y] && INPUT [=y] && INPUT_KEYBOARD [=y] && LEDS_CLASS [=y]

Make the 'select' statements conditional on that so we don't have to
introduce another 'select'.

Fixes: f8eb0235f659 ("x86: pcengines apuv2 gpio/leds/keys platform driver")
Fixes: a422bf11bdb4 ("platform/x86: fix PCENGINES_APU2 Kconfig warning")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/platform/x86/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index e869a5c760b6..cf48b9068843 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -1324,8 +1324,8 @@ config PCENGINES_APU2
 	tristate "PC Engines APUv2/3 front button and LEDs driver"
 	depends on INPUT && INPUT_KEYBOARD
 	depends on LEDS_CLASS
-	select GPIO_AMD_FCH
-	select KEYBOARD_GPIO_POLLED
+	select GPIO_AMD_FCH if GPIOLIB
+	select KEYBOARD_GPIO_POLLED if GPIOLIB
 	select LEDS_GPIO
 	help
 	  This driver provides support for the front button and LEDs on
-- 
2.20.0


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

* Re: [PATCH] platform/x86: pcengines-apu2 needs gpiolib
  2019-07-12  8:54 [PATCH] platform/x86: pcengines-apu2 needs gpiolib Arnd Bergmann
@ 2019-07-13 14:36 ` Enrico Weigelt, metux IT consult
  2019-07-13 15:34   ` Arnd Bergmann
  2019-07-14 16:41 ` Andy Shevchenko
  1 sibling, 1 reply; 4+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-07-13 14:36 UTC (permalink / raw)
  To: Arnd Bergmann, Darren Hart, Andy Shevchenko
  Cc: linux-gpio, linus.walleij, bgolaszewski, platform-driver-x86,
	Andy Shevchenko, Enrico Weigelt, metux IT consult, Randy Dunlap,
	Rafael J. Wysocki, linux-kernel

On 12.07.19 10:54, Arnd Bergmann wrote:

Hi,

> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index e869a5c760b6..cf48b9068843 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -1324,8 +1324,8 @@ config PCENGINES_APU2
>  	tristate "PC Engines APUv2/3 front button and LEDs driver"
>  	depends on INPUT && INPUT_KEYBOARD
>  	depends on LEDS_CLASS
> -	select GPIO_AMD_FCH
> -	select KEYBOARD_GPIO_POLLED
> +	select GPIO_AMD_FCH if GPIOLIB
> +	select KEYBOARD_GPIO_POLLED if GPIOLIB
>  	select LEDS_GPIO
>  	help
>  	  This driver provides support for the front button and LEDs on

That might compile but the driver won't work, if KEYBOARD_GPIO_POLLED
or GPIO_AMD_FCH isn't there.


--mtx

-- 
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287

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

* Re: [PATCH] platform/x86: pcengines-apu2 needs gpiolib
  2019-07-13 14:36 ` Enrico Weigelt, metux IT consult
@ 2019-07-13 15:34   ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2019-07-13 15:34 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult
  Cc: Darren Hart, Andy Shevchenko, open list:GPIO SUBSYSTEM,
	Linus Walleij, Bartosz Golaszewski, Platform Driver,
	Andy Shevchenko, Enrico Weigelt, metux IT consult, Randy Dunlap,
	Rafael J. Wysocki, Linux Kernel Mailing List

On Sat, Jul 13, 2019 at 4:36 PM Enrico Weigelt, metux IT consult
<lkml@metux.net> wrote:
> On 12.07.19 10:54, Arnd Bergmann wrote:
> > diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> > index e869a5c760b6..cf48b9068843 100644
> > --- a/drivers/platform/x86/Kconfig
> > +++ b/drivers/platform/x86/Kconfig
> > @@ -1324,8 +1324,8 @@ config PCENGINES_APU2
> >       tristate "PC Engines APUv2/3 front button and LEDs driver"
> >       depends on INPUT && INPUT_KEYBOARD
> >       depends on LEDS_CLASS
> > -     select GPIO_AMD_FCH
> > -     select KEYBOARD_GPIO_POLLED
> > +     select GPIO_AMD_FCH if GPIOLIB
> > +     select KEYBOARD_GPIO_POLLED if GPIOLIB
> >       select LEDS_GPIO
> >       help
> >         This driver provides support for the front button and LEDs on
>
> That might compile but the driver won't work, if KEYBOARD_GPIO_POLLED
> or GPIO_AMD_FCH isn't there.

Right, I agree it's a bit inconsistent. A better way would probably
be to turn all of the 'select' statements into 'depends on' here, or
possibly just remove them and document in the help text what others
are required.

Generally using 'select' in order to save users from thinking causes
more problems than it helps, as the build problems in this driver
have already illustrated.

      Arnd

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

* Re: [PATCH] platform/x86: pcengines-apu2 needs gpiolib
  2019-07-12  8:54 [PATCH] platform/x86: pcengines-apu2 needs gpiolib Arnd Bergmann
  2019-07-13 14:36 ` Enrico Weigelt, metux IT consult
@ 2019-07-14 16:41 ` Andy Shevchenko
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2019-07-14 16:41 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Darren Hart, Andy Shevchenko, open list:GPIO SUBSYSTEM,
	Linus Walleij, Bartosz Golaszewski, Platform Driver,
	Enrico Weigelt, metux IT consult, Randy Dunlap,
	Rafael J. Wysocki, Linux Kernel Mailing List

On Fri, Jul 12, 2019 at 11:54 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> I ran into another build issue in randconfig testing for this driver,
> when CONFIG_GPIOLIB is not set:
>
> WARNING: unmet direct dependencies detected for GPIO_AMD_FCH
>   Depends on [n]: GPIOLIB [=n] && HAS_IOMEM [=y]
>   Selected by [y]:
>   - PCENGINES_APU2 [=y] && X86 [=y] && X86_PLATFORM_DEVICES [=y] && INPUT [=y] && INPUT_KEYBOARD [=y] && LEDS_CLASS [=y]
>
> WARNING: unmet direct dependencies detected for KEYBOARD_GPIO_POLLED
>   Depends on [n]: !UML && INPUT [=y] && INPUT_KEYBOARD [=y] && GPIOLIB [=n]
>   Selected by [y]:
>   - PCENGINES_APU2 [=y] && X86 [=y] && X86_PLATFORM_DEVICES [=y] && INPUT [=y] && INPUT_KEYBOARD [=y] && LEDS_CLASS [=y]
>
> Make the 'select' statements conditional on that so we don't have to
> introduce another 'select'.
>

Thanks, I have applied the fix from YueHaibing, the idea is to depened
on GPIOLIB.


> Fixes: f8eb0235f659 ("x86: pcengines apuv2 gpio/leds/keys platform driver")
> Fixes: a422bf11bdb4 ("platform/x86: fix PCENGINES_APU2 Kconfig warning")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/platform/x86/Kconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index e869a5c760b6..cf48b9068843 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -1324,8 +1324,8 @@ config PCENGINES_APU2
>         tristate "PC Engines APUv2/3 front button and LEDs driver"
>         depends on INPUT && INPUT_KEYBOARD
>         depends on LEDS_CLASS
> -       select GPIO_AMD_FCH
> -       select KEYBOARD_GPIO_POLLED
> +       select GPIO_AMD_FCH if GPIOLIB
> +       select KEYBOARD_GPIO_POLLED if GPIOLIB
>         select LEDS_GPIO
>         help
>           This driver provides support for the front button and LEDs on
> --
> 2.20.0
>


-- 
With Best Regards,
Andy Shevchenko

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

end of thread, other threads:[~2019-07-14 16:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-12  8:54 [PATCH] platform/x86: pcengines-apu2 needs gpiolib Arnd Bergmann
2019-07-13 14:36 ` Enrico Weigelt, metux IT consult
2019-07-13 15:34   ` Arnd Bergmann
2019-07-14 16:41 ` Andy Shevchenko

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