linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: applespi - Fix build error
@ 2019-07-29  3:14 YueHaibing
  2019-07-29 14:04 ` Dmitry Torokhov
  2019-07-30 13:34 ` [PATCH v2] " YueHaibing
  0 siblings, 2 replies; 6+ messages in thread
From: YueHaibing @ 2019-07-29  3:14 UTC (permalink / raw)
  To: ronald, dmitry.torokhov, nikolas; +Cc: linux-kernel, linux-input, YueHaibing

If CONFIG_KEYBOARD_APPLESPI=y but CONFIG_LEDS_CLASS=m
building fails:

drivers/input/keyboard/applespi.o: In function `applespi_probe':
applespi.c:(.text+0x1fcd): undefined reference to `devm_led_classdev_register_ext'

Wrap it in LEDS_CLASS macro to fix this.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 038b1a05eae6 ("Input: add Apple SPI keyboard and trackpad driver")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/input/keyboard/applespi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/input/keyboard/applespi.c b/drivers/input/keyboard/applespi.c
index acf34a5..9c50b09 100644
--- a/drivers/input/keyboard/applespi.c
+++ b/drivers/input/keyboard/applespi.c
@@ -1790,11 +1790,13 @@ static int applespi_probe(struct spi_device *spi)
 	applespi->backlight_info.default_trigger = "kbd-backlight";
 	applespi->backlight_info.brightness_set  = applespi_set_bl_level;
 
+#ifdef CONFIG_LEDS_CLASS
 	sts = devm_led_classdev_register(&spi->dev, &applespi->backlight_info);
 	if (sts)
 		dev_warn(&applespi->spi->dev,
 			 "Unable to register keyboard backlight class dev (%d)\n",
 			 sts);
+#endif
 
 	/* set up debugfs entries for touchpad dimensions logging */
 	applespi->debugfs_root = debugfs_create_dir("applespi", NULL);
-- 
2.7.4



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

* Re: [PATCH] Input: applespi - Fix build error
  2019-07-29  3:14 [PATCH] Input: applespi - Fix build error YueHaibing
@ 2019-07-29 14:04 ` Dmitry Torokhov
  2019-07-30  7:01   ` Life is hard, and then you die
  2019-07-30 13:34 ` [PATCH v2] " YueHaibing
  1 sibling, 1 reply; 6+ messages in thread
From: Dmitry Torokhov @ 2019-07-29 14:04 UTC (permalink / raw)
  To: YueHaibing; +Cc: ronald, nikolas, linux-kernel, linux-input

On Mon, Jul 29, 2019 at 11:14:55AM +0800, YueHaibing wrote:
> If CONFIG_KEYBOARD_APPLESPI=y but CONFIG_LEDS_CLASS=m
> building fails:
> 
> drivers/input/keyboard/applespi.o: In function `applespi_probe':
> applespi.c:(.text+0x1fcd): undefined reference to `devm_led_classdev_register_ext'
> 
> Wrap it in LEDS_CLASS macro to fix this.

No, we should add "depends on LEDS_CLASS" to the Konfig instead.

Thanks.

-- 
Dmitry

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

* Re: [PATCH] Input: applespi - Fix build error
  2019-07-29 14:04 ` Dmitry Torokhov
@ 2019-07-30  7:01   ` Life is hard, and then you die
  2019-07-30  7:22     ` Yuehaibing
  0 siblings, 1 reply; 6+ messages in thread
From: Life is hard, and then you die @ 2019-07-30  7:01 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: YueHaibing, nikolas, linux-kernel, linux-input


On Mon, Jul 29, 2019 at 04:04:38PM +0200, Dmitry Torokhov wrote:
> On Mon, Jul 29, 2019 at 11:14:55AM +0800, YueHaibing wrote:
> > If CONFIG_KEYBOARD_APPLESPI=y but CONFIG_LEDS_CLASS=m
> > building fails:
> > 
> > drivers/input/keyboard/applespi.o: In function `applespi_probe':
> > applespi.c:(.text+0x1fcd): undefined reference to `devm_led_classdev_register_ext'
> > 
> > Wrap it in LEDS_CLASS macro to fix this.
> 
> No, we should add "depends on LEDS_CLASS" to the Konfig instead.

While the loss of keyboard-backlight functionality is certainly not
critical, in practice when building a kernel for desktops/laptops
(i.e. where this module would be used) I see no real reason why you'd
not have/want LEDS_CLASS enabled. So I'd agree with Dmitry that a
Kconfig depends-on is probably the preferred approach.


  Cheers,

  Ronald


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

* Re: [PATCH] Input: applespi - Fix build error
  2019-07-30  7:01   ` Life is hard, and then you die
@ 2019-07-30  7:22     ` Yuehaibing
  0 siblings, 0 replies; 6+ messages in thread
From: Yuehaibing @ 2019-07-30  7:22 UTC (permalink / raw)
  To: Life is hard, and then you die, Dmitry Torokhov
  Cc: nikolas, linux-kernel, linux-input

On 2019/7/30 15:01, Life is hard, and then you die wrote:
> 
> On Mon, Jul 29, 2019 at 04:04:38PM +0200, Dmitry Torokhov wrote:
>> On Mon, Jul 29, 2019 at 11:14:55AM +0800, YueHaibing wrote:
>>> If CONFIG_KEYBOARD_APPLESPI=y but CONFIG_LEDS_CLASS=m
>>> building fails:
>>>
>>> drivers/input/keyboard/applespi.o: In function `applespi_probe':
>>> applespi.c:(.text+0x1fcd): undefined reference to `devm_led_classdev_register_ext'
>>>
>>> Wrap it in LEDS_CLASS macro to fix this.
>>
>> No, we should add "depends on LEDS_CLASS" to the Konfig instead.
> 
> While the loss of keyboard-backlight functionality is certainly not
> critical, in practice when building a kernel for desktops/laptops
> (i.e. where this module would be used) I see no real reason why you'd
> not have/want LEDS_CLASS enabled. So I'd agree with Dmitry that a
> Kconfig depends-on is probably the preferred approach.

Thanks, will send v2 as suggestion.

> 
> 
>   Cheers,
> 
>   Ronald
> 
> 
> .
> 


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

* [PATCH v2] Input: applespi - Fix build error
  2019-07-29  3:14 [PATCH] Input: applespi - Fix build error YueHaibing
  2019-07-29 14:04 ` Dmitry Torokhov
@ 2019-07-30 13:34 ` YueHaibing
  2019-07-31 13:49   ` Dmitry Torokhov
  1 sibling, 1 reply; 6+ messages in thread
From: YueHaibing @ 2019-07-30 13:34 UTC (permalink / raw)
  To: ronald, dmitry.torokhov, nikolas; +Cc: linux-kernel, linux-input, YueHaibing

If CONFIG_KEYBOARD_APPLESPI=y but CONFIG_LEDS_CLASS=m
building fails:

drivers/input/keyboard/applespi.o: In function `applespi_probe':
applespi.c:(.text+0x1fcd): undefined reference to `devm_led_classdev_register_ext'

Add "depends on LEDS_CLASS" to the Konfig

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 038b1a05eae6 ("Input: add Apple SPI keyboard and trackpad driver")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: use 'depends on LEDS_CLASS'
---
 drivers/input/keyboard/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index ebb19e2..90e8a7f 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -76,6 +76,7 @@ config KEYBOARD_APPLESPI
 	depends on ACPI && EFI
 	depends on SPI
 	depends on X86 || COMPILE_TEST
+	depends on LEDS_CLASS
 	select CRC16
 	help
 	  Say Y here if you are running Linux on any Apple MacBook8,1 or later,
-- 
2.7.4



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

* Re: [PATCH v2] Input: applespi - Fix build error
  2019-07-30 13:34 ` [PATCH v2] " YueHaibing
@ 2019-07-31 13:49   ` Dmitry Torokhov
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2019-07-31 13:49 UTC (permalink / raw)
  To: YueHaibing; +Cc: ronald, nikolas, linux-kernel, linux-input

On Tue, Jul 30, 2019 at 09:34:14PM +0800, YueHaibing wrote:
> If CONFIG_KEYBOARD_APPLESPI=y but CONFIG_LEDS_CLASS=m
> building fails:
> 
> drivers/input/keyboard/applespi.o: In function `applespi_probe':
> applespi.c:(.text+0x1fcd): undefined reference to `devm_led_classdev_register_ext'
> 
> Add "depends on LEDS_CLASS" to the Konfig
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: 038b1a05eae6 ("Input: add Apple SPI keyboard and trackpad driver")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Applied, thank you.

> ---
> v2: use 'depends on LEDS_CLASS'
> ---
>  drivers/input/keyboard/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
> index ebb19e2..90e8a7f 100644
> --- a/drivers/input/keyboard/Kconfig
> +++ b/drivers/input/keyboard/Kconfig
> @@ -76,6 +76,7 @@ config KEYBOARD_APPLESPI
>  	depends on ACPI && EFI
>  	depends on SPI
>  	depends on X86 || COMPILE_TEST
> +	depends on LEDS_CLASS
>  	select CRC16
>  	help
>  	  Say Y here if you are running Linux on any Apple MacBook8,1 or later,
> -- 
> 2.7.4
> 
> 

-- 
Dmitry

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

end of thread, other threads:[~2019-07-31 13:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29  3:14 [PATCH] Input: applespi - Fix build error YueHaibing
2019-07-29 14:04 ` Dmitry Torokhov
2019-07-30  7:01   ` Life is hard, and then you die
2019-07-30  7:22     ` Yuehaibing
2019-07-30 13:34 ` [PATCH v2] " YueHaibing
2019-07-31 13:49   ` Dmitry Torokhov

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