]> git.baikalelectronics.ru Git - kernel.git/commit
HID: i2c-hid: check if device is there before really probing
authorDmitry Torokhov <dtor@chromium.org>
Wed, 9 May 2018 19:12:15 +0000 (12:12 -0700)
committerJiri Kosina <jkosina@suse.cz>
Tue, 15 May 2018 09:15:05 +0000 (11:15 +0200)
commit4eb1d8d346e5547dbf8f97a9aec300f99566630f
tree2aa89b56e850590c14576648ef3affbed89112aa
parent08ed18677f1d5ff537e6741c0e399e65c1fa4d4e
HID: i2c-hid: check if device is there before really probing

On many Chromebooks touch devices are multi-sourced; the components are
electrically compatible and one can be freely swapped for another without
changing the OS image or firmware.

To avoid bunch of scary messages when device is not actually present in the
system let's try testing basic communication with it and if there is no
response terminate probe early with -ENXIO.

Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/i2c-hid/i2c-hid.c