[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <525a78c1-3867-5129-57a7-b3dca9eff874@infradead.org>
Date: Thu, 7 Apr 2022 08:33:50 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Finn Thain <fthain@...ux-m68k.org>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Christophe Leroy <christophe.leroy@...roup.eu>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] macintosh/via-pmu: Fix build failure when CONFIG_INPUT
is disabled
On 4/7/22 03:11, Finn Thain wrote:
> drivers/macintosh/via-pmu-event.o: In function `via_pmu_event':
> via-pmu-event.c:(.text+0x44): undefined reference to `input_event'
> via-pmu-event.c:(.text+0x68): undefined reference to `input_event'
> via-pmu-event.c:(.text+0x94): undefined reference to `input_event'
> via-pmu-event.c:(.text+0xb8): undefined reference to `input_event'
> drivers/macintosh/via-pmu-event.o: In function `via_pmu_event_init':
> via-pmu-event.c:(.init.text+0x20): undefined reference to `input_allocate_device'
> via-pmu-event.c:(.init.text+0xc4): undefined reference to `input_register_device'
> via-pmu-event.c:(.init.text+0xd4): undefined reference to `input_free_device'
> make[1]: *** [Makefile:1155: vmlinux] Error 1
> make: *** [Makefile:350: __build_one_by_one] Error 2
>
> Don't call into the input subsystem unless CONFIG_INPUT is built-in.
>
> Cc: Christophe Leroy <christophe.leroy@...roup.eu>
> Cc: Randy Dunlap <rdunlap@...radead.org>
> Cc: Geert Uytterhoeven <geert@...ux-m68k.org>
> Reported-by: kernel test robot <lkp@...el.com>
> Signed-off-by: Finn Thain <fthain@...ux-m68k.org>
Acked-by: Randy Dunlap <rdunlap@...radead.org>
Tested-by: Randy Dunlap <rdunlap@...radead.org>
Thanks.
> ---
> Changed since v1:
> - Adopted IS_ENABLED to avoid an ifdef as suggested by Christophe.
> - Added the ADB_PMU_EVENT symbol as suggested by Geert, though this
> adds a new Kconfig symbol for little gain AFAICS.
> ---
> drivers/macintosh/Kconfig | 4 ++++
> drivers/macintosh/Makefile | 3 ++-
> drivers/macintosh/via-pmu.c | 2 +-
> 3 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig
> index 5cdc361da37c..3942db15a2b8 100644
> --- a/drivers/macintosh/Kconfig
> +++ b/drivers/macintosh/Kconfig
> @@ -67,6 +67,10 @@ config ADB_PMU
> this device; you should do so if your machine is one of those
> mentioned above.
>
> +config ADB_PMU_EVENT
> + def_bool y
> + depends on ADB_PMU && INPUT=y
> +
> config ADB_PMU_LED
> bool "Support for the Power/iBook front LED"
> depends on PPC_PMAC && ADB_PMU
> diff --git a/drivers/macintosh/Makefile b/drivers/macintosh/Makefile
> index 49819b1b6f20..712edcb3e0b0 100644
> --- a/drivers/macintosh/Makefile
> +++ b/drivers/macintosh/Makefile
> @@ -12,7 +12,8 @@ obj-$(CONFIG_MAC_EMUMOUSEBTN) += mac_hid.o
> obj-$(CONFIG_INPUT_ADBHID) += adbhid.o
> obj-$(CONFIG_ANSLCD) += ans-lcd.o
>
> -obj-$(CONFIG_ADB_PMU) += via-pmu.o via-pmu-event.o
> +obj-$(CONFIG_ADB_PMU) += via-pmu.o
> +obj-$(CONFIG_ADB_PMU_EVENT) += via-pmu-event.o
> obj-$(CONFIG_ADB_PMU_LED) += via-pmu-led.o
> obj-$(CONFIG_PMAC_BACKLIGHT) += via-pmu-backlight.o
> obj-$(CONFIG_ADB_CUDA) += via-cuda.o
> diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
> index 399074306a74..495fd35b11de 100644
> --- a/drivers/macintosh/via-pmu.c
> +++ b/drivers/macintosh/via-pmu.c
> @@ -1463,7 +1463,7 @@ pmu_handle_data(unsigned char *data, int len)
> pmu_pass_intr(data, len);
> /* len == 6 is probably a bad check. But how do I
> * know what PMU versions send what events here? */
> - if (len == 6) {
> + if (IS_ENABLED(CONFIG_ADB_PMU_EVENT) && len == 6) {
> via_pmu_event(PMU_EVT_POWER, !!(data[1]&8));
> via_pmu_event(PMU_EVT_LID, data[1]&1);
> }
--
~Randy
Powered by blists - more mailing lists