Re: [PATCH v2] Input: elan_i2c - check if device is there before really probing

2017-05-09 Thread Fabio Estevam
On Tue, May 9, 2017 at 9:46 PM, Dmitry Torokhov wrote: > That is the point of the patch - we want to fail silently if the device > is not actually there and fails even the simplest communication. Driver > core treats ENXIO and ENODEV as special and does not log errors. Got it, thanks for the exp

Re: [PATCH v2] Input: elan_i2c - check if device is there before really probing

2017-05-09 Thread Dmitry Torokhov
On Mon, May 08, 2017 at 10:43:36PM -0300, Fabio Estevam wrote: > On Mon, May 8, 2017 at 9:45 PM, Dmitry Torokhov > wrote: > > > + /* Make sure there is something at this address */ > > + error = i2c_smbus_read_byte(client); > > + if (error < 0) { > > + dev_dbg(&cli

Re: [PATCH v2] Input: elan_i2c - check if device is there before really probing

2017-05-08 Thread Fabio Estevam
On Mon, May 8, 2017 at 9:45 PM, Dmitry Torokhov wrote: > + /* Make sure there is something at this address */ > + error = i2c_smbus_read_byte(client); > + if (error < 0) { > + dev_dbg(&client->dev, "nothing at this address: %d\n", error); > + return -

[PATCH v2] Input: elan_i2c - check if device is there before really probing

2017-05-08 Thread Dmitry Torokhov
Before trying to properly initialize the touchpad and generate bunch of errors, let's first see it there is anything at the given address. If we get error, fail silently with -ENXIO. Signed-off-by: Dmitry Torokhov --- v2: switched over to i2c_smbus_read_byte() as Guenter suggested drivers/inpu