Input: elants_i2c - fix NULL dereference at probing
authorTakashi Iwai <tiwai@suse.de>
Mon, 31 May 2021 04:43:36 +0000 (21:43 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 31 May 2021 04:53:48 +0000 (21:53 -0700)
commitb9c0ebb867d67cc4e9e1a7a2abf0ac9a2cc02051
tree22976d83803d6e850ca8d2d2a1c43bca21449dc0
parent0b1d6c8c00157cbfcf343925c4de81af0187a7b7
Input: elants_i2c - fix NULL dereference at probing

The recent change in elants_i2c driver to support more chips
introduced a regression leading to Oops at probing.  The driver reads
id->driver_data, but the id may be NULL depending on the device type
the driver gets bound.

Replace the driver data extraction with the device_get_match_data()
helper, and define the driver data in OF table, too.

Fixes: 9517b95bdc46 ("Input: elants_i2c - add support for eKTF3624")
BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1186454
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210528071024.26450-1-tiwai@suse.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/elants_i2c.c