diff mbox

[09/27] leds: Allow compile test of GPIO consumers if !GPIOLIB

Message ID 1430843563-18615-9-git-send-email-geert@linux-m68k.org
State New
Headers show

Commit Message

Geert Uytterhoeven May 5, 2015, 4:32 p.m. UTC
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.

Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
appropriate.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Bryan Wu <cooloney@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: linux-leds@vger.kernel.org
---
 drivers/leds/Kconfig         | 2 +-
 drivers/leds/trigger/Kconfig | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Jacek Anaszewski May 6, 2015, 7:58 a.m. UTC | #1
Hi Geert,

Why don't you apply the same modification to all LED Kconfig
entries with GPIOLIB dependency?

On 05/05/2015 06:32 PM, Geert Uytterhoeven wrote:
> The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
> not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
> functionality only, can still be compiled if GPIOLIB is not enabled.
>
> Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
> appropriate.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Bryan Wu <cooloney@gmail.com>
> Cc: Richard Purdie <rpurdie@rpsys.net>
> Cc: linux-leds@vger.kernel.org
> ---
>   drivers/leds/Kconfig         | 2 +-
>   drivers/leds/trigger/Kconfig | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> index 966b9605f5f0660c..8161cddc3f8d597a 100644
> --- a/drivers/leds/Kconfig
> +++ b/drivers/leds/Kconfig
> @@ -395,7 +395,7 @@ config LEDS_INTEL_SS4200
>   config LEDS_LT3593
>   	tristate "LED driver for LT3593 controllers"
>   	depends on LEDS_CLASS
> -	depends on GPIOLIB
> +	depends on GPIOLIB || COMPILE_TEST
>   	help
>   	  This option enables support for LEDs driven by a Linear Technology
>   	  LT3593 controller. This controller uses a special one-wire pulse
> diff --git a/drivers/leds/trigger/Kconfig b/drivers/leds/trigger/Kconfig
> index 49794b47b51c498d..5bda6a9b56bbd90b 100644
> --- a/drivers/leds/trigger/Kconfig
> +++ b/drivers/leds/trigger/Kconfig
> @@ -72,7 +72,7 @@ config LEDS_TRIGGER_CPU
>   config LEDS_TRIGGER_GPIO
>   	tristate "LED GPIO Trigger"
>   	depends on LEDS_TRIGGERS
> -	depends on GPIOLIB
> +	depends on GPIOLIB || COMPILE_TEST
>   	help
>   	  This allows LEDs to be controlled by gpio events. It's good
>   	  when using gpios as switches and triggering the needed LEDs
>
Geert Uytterhoeven May 6, 2015, 8:31 a.m. UTC | #2
Hi Jacek,

On Wed, May 6, 2015 at 9:58 AM, Jacek Anaszewski
<j.anaszewski@samsung.com> wrote:
> Why don't you apply the same modification to all LED Kconfig
> entries with GPIOLIB dependency?

LEDS_PCA9532_GPIO is a GPIO provider, not a consumer. There are no
dummies for GPIO providers.
LEDS_GPIO doesn't compile if !GPIOLIB, but I missed that it's just due to
a missing dummy for devm_get_gpiod_from_child() and a missing include.
Will fix.

Thanks!

> On 05/05/2015 06:32 PM, Geert Uytterhoeven wrote:
>> The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
>> not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
>> functionality only, can still be compiled if GPIOLIB is not enabled.
>>
>> Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
>> appropriate.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jacek Anaszewski May 7, 2015, 12:14 p.m. UTC | #3
On 05/05/2015 06:32 PM, Geert Uytterhoeven wrote:
> The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
> not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
> functionality only, can still be compiled if GPIOLIB is not enabled.
>
> Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
> appropriate.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Bryan Wu <cooloney@gmail.com>
> Cc: Richard Purdie <rpurdie@rpsys.net>
> Cc: linux-leds@vger.kernel.org
> ---
>   drivers/leds/Kconfig         | 2 +-
>   drivers/leds/trigger/Kconfig | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> index 966b9605f5f0660c..8161cddc3f8d597a 100644
> --- a/drivers/leds/Kconfig
> +++ b/drivers/leds/Kconfig
> @@ -395,7 +395,7 @@ config LEDS_INTEL_SS4200
>   config LEDS_LT3593
>   	tristate "LED driver for LT3593 controllers"
>   	depends on LEDS_CLASS
> -	depends on GPIOLIB
> +	depends on GPIOLIB || COMPILE_TEST
>   	help
>   	  This option enables support for LEDs driven by a Linear Technology
>   	  LT3593 controller. This controller uses a special one-wire pulse
> diff --git a/drivers/leds/trigger/Kconfig b/drivers/leds/trigger/Kconfig
> index 49794b47b51c498d..5bda6a9b56bbd90b 100644
> --- a/drivers/leds/trigger/Kconfig
> +++ b/drivers/leds/trigger/Kconfig
> @@ -72,7 +72,7 @@ config LEDS_TRIGGER_CPU
>   config LEDS_TRIGGER_GPIO
>   	tristate "LED GPIO Trigger"
>   	depends on LEDS_TRIGGERS
> -	depends on GPIOLIB
> +	depends on GPIOLIB || COMPILE_TEST
>   	help
>   	  This allows LEDs to be controlled by gpio events. It's good
>   	  when using gpios as switches and triggering the needed LEDs
>

Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
diff mbox

Patch

diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 966b9605f5f0660c..8161cddc3f8d597a 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -395,7 +395,7 @@  config LEDS_INTEL_SS4200
 config LEDS_LT3593
 	tristate "LED driver for LT3593 controllers"
 	depends on LEDS_CLASS
-	depends on GPIOLIB
+	depends on GPIOLIB || COMPILE_TEST
 	help
 	  This option enables support for LEDs driven by a Linear Technology
 	  LT3593 controller. This controller uses a special one-wire pulse
diff --git a/drivers/leds/trigger/Kconfig b/drivers/leds/trigger/Kconfig
index 49794b47b51c498d..5bda6a9b56bbd90b 100644
--- a/drivers/leds/trigger/Kconfig
+++ b/drivers/leds/trigger/Kconfig
@@ -72,7 +72,7 @@  config LEDS_TRIGGER_CPU
 config LEDS_TRIGGER_GPIO
 	tristate "LED GPIO Trigger"
 	depends on LEDS_TRIGGERS
-	depends on GPIOLIB
+	depends on GPIOLIB || COMPILE_TEST
 	help
 	  This allows LEDs to be controlled by gpio events. It's good
 	  when using gpios as switches and triggering the needed LEDs