1
0
Fork 0
alistair23-linux/drivers/input
Hans de Goede 8f68a28c9e Input: i8042 - allow insmod to succeed on devices without an i8042 controller
[ Upstream commit b1884583fc ]

The i8042 module exports several symbols which may be used by other
modules.

Before this commit it would refuse to load (when built as a module itself)
on systems without an i8042 controller.

This is a problem specifically for the asus-nb-wmi module. Many Asus
laptops support the Asus WMI interface. Some of them have an i8042
controller and need to use i8042_install_filter() to filter some kbd
events. Other models do not have an i8042 controller (e.g. they use an
USB attached kbd).

Before this commit the asus-nb-wmi driver could not be loaded on Asus
models without an i8042 controller, when the i8042 code was built as
a module (as Arch Linux does) because the module_init function of the
i8042 module would fail with -ENODEV and thus the i8042_install_filter
symbol could not be loaded.

This commit fixes this by exiting from module_init with a return code
of 0 if no controller is found.  It also adds a i8042_present bool to
make the module_exit function a no-op in this case and also adds a
check for i8042_present to the exported i8042_command function.

The latter i8042_present check should not really be necessary because
when builtin that function can already be used on systems without
an i8042 controller, but better safe then sorry.

Reported-and-tested-by: Marius Iacob <themariusus@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20201008112628.3979-2-hdegoede@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-12-02 08:49:47 +01:00
..
gameport treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
joystick Input: xpad - add custom init packet for Xbox One S controllers 2020-06-03 08:21:16 +02:00
keyboard Input: sunkbd - avoid use-after-free in teardown paths 2020-11-22 10:14:12 +01:00
misc Input: adxl34x - clean up a data type in adxl34x_probe() 2020-11-24 13:29:04 +01:00
mouse Input: trackpoint - enable Synaptics trackpoints 2020-10-07 08:01:29 +02:00
rmi4 Input: synaptics-rmi4 - fix error return code in rmi_driver_probe() 2020-06-03 08:21:17 +02:00
serio Input: i8042 - allow insmod to succeed on devices without an i8042 controller 2020-12-02 08:49:47 +01:00
tablet Input: pegasus_notetaker - fix endpoint sanity check 2020-01-29 16:45:29 +01:00
touchscreen Input: resistive-adc-touch - fix kconfig dependency on IIO_BUFFER 2020-11-24 13:29:05 +01:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile Input: add support for polling to input devices 2019-08-20 12:04:07 -07:00
apm-power.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
evbug.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
evdev.c Input: evdev - call input_flush_device() on release(), not flush() 2020-06-03 08:21:16 +02:00
ff-core.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ff-memless.c Input: ff-memless - kill timer in destroy() 2019-11-15 11:45:03 -08:00
input-compat.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
input-compat.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
input-leds.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
input-mt.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
input-polldev.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
input-poller.c Input: add support for polling to input devices 2019-08-20 12:04:07 -07:00
input-poller.h Input: add support for polling to input devices 2019-08-20 12:04:07 -07:00
input.c Input: fix stale timestamp on key autorepeat events 2020-04-01 11:01:57 +02:00
joydev.c Linux 5.2 2019-07-15 09:42:32 -07:00
matrix-keymap.c Input: matrix-keymap - switch to use device_property_count_u32() 2019-08-12 00:03:13 -07:00
mousedev.c *: convert stream-like files -> stream_open, even if they use noop_llseek 2019-07-14 16:09:19 +03:00
sparse-keymap.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00