summaryrefslogtreecommitdiff
path: root/drivers/input/mouse/psmouse-smbus.c
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2018-05-23 03:28:23 +0300
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2018-05-24 02:49:22 +0300
commit21c48dbde0944e3d52468008321900af3bdafcf1 (patch)
tree076300cb80f45799824b1f550fe04bdf9a3c8983 /drivers/input/mouse/psmouse-smbus.c
parent80212ed743d7d6618a33cf4d37fc625a061faf22 (diff)
downloadlinux-21c48dbde0944e3d52468008321900af3bdafcf1.tar.xz
Input: elantech - add support for SMBus devices
Many of the Elantech devices are connected through PS/2 and a different bus (SMBus or plain I2C). To not break any existing device, we only enable SMBus based on a module parameter. If some laptops require the quirk to be set, we will have to rely on a list of PNPIds or MDI matching to individually expose those hardware over SMBus. the parameter mentioned above is elantech_smbus from the psmouse module. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: KT Liao <kt.liao@emc.com.tw> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/mouse/psmouse-smbus.c')
-rw-r--r--drivers/input/mouse/psmouse-smbus.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/input/mouse/psmouse-smbus.c b/drivers/input/mouse/psmouse-smbus.c
index c7ac24d119c1..c8a3b1f35ce3 100644
--- a/drivers/input/mouse/psmouse-smbus.c
+++ b/drivers/input/mouse/psmouse-smbus.c
@@ -237,10 +237,13 @@ int psmouse_smbus_init(struct psmouse *psmouse,
smbdev->psmouse = psmouse;
smbdev->board = *board;
- smbdev->board.platform_data = kmemdup(pdata, pdata_size, GFP_KERNEL);
- if (!smbdev->board.platform_data) {
- kfree(smbdev);
- return -ENOMEM;
+ if (pdata) {
+ smbdev->board.platform_data = kmemdup(pdata, pdata_size,
+ GFP_KERNEL);
+ if (!smbdev->board.platform_data) {
+ kfree(smbdev);
+ return -ENOMEM;
+ }
}
psmouse->private = smbdev;