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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:50:34 +0000 (07:50 +0200)
commitd0eca5d32b11ef4d7c176a362c55e4ed53f13a73
tree851450301475868c8b6f7c46e0bdd8f3473806b8
parent83eef34c65f179af463924e34fc687426ac2f705
HID: i2c-hid: check if device is there before really probing

[ Upstream commit b3a81b6c4fc6730ac49e20d789a93c0faabafc98 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/i2c-hid/i2c-hid.c