diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-01-27 18:43:32 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2016-01-27 18:55:14 -0500 |
commit | af6e94634d0a77aa42a9fdee35abd00a95b4ca54 (patch) | |
tree | ad2e90bd9604e98d785d2c0b7944013e63cd2caa | |
parent | a6ed4a18ba6a6f5a01e024b9d221d6439bf6ca4c (diff) |
Input: sirfsoc-onkey - allow modular build
CONFIG_INPUT may itself be a loadable module, but the sirf power key
driver is listed as 'bool', which makes it possible to select
a broken configuration with the driver built-in but the subsystem
not loaded. In this configuration, we get a link error:
drivers/input/built-in.o: In function `sirfsoc_pwrc_isr':
drivers/input/misc/sirfsoc-onkey.c:63: undefined reference to `input_event'
drivers/input/built-in.o: In function `sirfsoc_pwrc_isr':
include/linux/input.h:414: undefined reference to `input_event'
drivers/input/built-in.o: In function `sirfsoc_pwrc_probe':
drivers/input/misc/sirfsoc-onkey.c:132: undefined reference to `devm_input_allocate_device'
drivers/input/misc/sirfsoc-onkey.c:139: undefined reference to `input_set_capability'
drivers/input/misc/sirfsoc-onkey.c:161: undefined reference to `input_register_device'
drivers/input/built-in.o: In function `sirfsoc_pwrc_report_event':
drivers/input/misc/sirfsoc-onkey.c:48: undefined reference to `input_event'
drivers/input/built-in.o: In function `sirfsoc_pwrc_report_event':
include/linux/input.h:414: undefined reference to `input_event'
drivers/input/built-in.o:(.debug_addr+0x24): undefined reference to `input_event'
drivers/input/built-in.o:(.debug_addr+0xbc): undefined reference to `devm_input_allocate_device'
drivers/input/built-in.o:(.debug_addr+0x104): undefined reference to `input_set_capability'
drivers/input/built-in.o:(.debug_addr+0x128): undefined reference to `input_register_device'
This marks the driver as 'tristate' so it becomes possible to have
it in a loadable module, mainly to help with randconfig builds.
We also have to add a missing semicolon here, which ended up not
being needed in built-in mode because the following MODULE_DEVICE_TABLE
is an empty macro followed by another semicolon then.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/misc/Kconfig | 2 | ||||
-rw-r--r-- | drivers/input/misc/sirfsoc-onkey.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index d6d16fa78281..1f2337abcf2f 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig | |||
@@ -733,7 +733,7 @@ config INPUT_XEN_KBDDEV_FRONTEND | |||
733 | module will be called xen-kbdfront. | 733 | module will be called xen-kbdfront. |
734 | 734 | ||
735 | config INPUT_SIRFSOC_ONKEY | 735 | config INPUT_SIRFSOC_ONKEY |
736 | bool "CSR SiRFSoC power on/off/suspend key support" | 736 | tristate "CSR SiRFSoC power on/off/suspend key support" |
737 | depends on ARCH_SIRF && OF | 737 | depends on ARCH_SIRF && OF |
738 | default y | 738 | default y |
739 | help | 739 | help |
diff --git a/drivers/input/misc/sirfsoc-onkey.c b/drivers/input/misc/sirfsoc-onkey.c index 9d5b89befe6f..ed7237f19539 100644 --- a/drivers/input/misc/sirfsoc-onkey.c +++ b/drivers/input/misc/sirfsoc-onkey.c | |||
@@ -101,7 +101,7 @@ static void sirfsoc_pwrc_close(struct input_dev *input) | |||
101 | static const struct of_device_id sirfsoc_pwrc_of_match[] = { | 101 | static const struct of_device_id sirfsoc_pwrc_of_match[] = { |
102 | { .compatible = "sirf,prima2-pwrc" }, | 102 | { .compatible = "sirf,prima2-pwrc" }, |
103 | {}, | 103 | {}, |
104 | } | 104 | }; |
105 | MODULE_DEVICE_TABLE(of, sirfsoc_pwrc_of_match); | 105 | MODULE_DEVICE_TABLE(of, sirfsoc_pwrc_of_match); |
106 | 106 | ||
107 | static int sirfsoc_pwrc_probe(struct platform_device *pdev) | 107 | static int sirfsoc_pwrc_probe(struct platform_device *pdev) |