lkml.org 
[lkml]   [2017]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] Input: elan_i2c - check if device is there before really probing
On Mon, May 08, 2017 at 10:43:36PM -0300, Fabio Estevam wrote:
> On Mon, May 8, 2017 at 9:45 PM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> 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 -ENXIO;
>
> You could return the real error code here: 'return error'

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.

Thanks.

--
Dmitry

\
 
 \ /
  Last update: 2017-05-10 21:20    [W:0.059 / U:1.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site