]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
macintosh/via-pmu: Fix build failure when CONFIG_INPUT is disabled
authorFinn Thain <fthain@linux-m68k.org>
Thu, 7 Apr 2022 10:11:32 +0000 (20:11 +1000)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 10 Aug 2022 07:23:58 +0000 (09:23 +0200)
BugLink: https://bugs.launchpad.net/bugs/1981864
[ Upstream commit 86ce436e30d86327c9f5260f718104ae7b21f506 ]

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.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/5edbe76ce68227f71e09af4614cc4c1bd61c7ec8.1649326292.git.fthain@linux-m68k.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/macintosh/Kconfig
drivers/macintosh/Makefile
drivers/macintosh/via-pmu.c

index 5cdc361da37cb0995eb58b6bdfa450c25f8fe12a..3942db15a2b8d21437081c1b643ae7a35657f221 100644 (file)
@@ -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
index 49819b1b6f2010d5f0c057036a432f191f8e9367..712edcb3e0b0819665099ce023b32de83951726d 100644 (file)
@@ -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
index 4b98bc26a94b564a116952536642f97ea7ca69eb..2109129ea1bbfcf4dc6d83598b2a0ff9cb212bf2 100644 (file)
@@ -1459,7 +1459,7 @@ next:
                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);
                }