Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1638471
| From | Dmitry Torokhov <dmitry.torokhov@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] Input: elan_i2c - check if device is there before really probing |
| Date | 2017-05-10 02:50 +0200 |
| Message-ID | <tFnZf-Uf-1@gated-at.bofh.it> (permalink) |
| References | <tF1vH-2K6-1@gated-at.bofh.it> <tF2rM-3nF-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2] Input: elan_i2c - check if device is there before really probing Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-05-09 02:50 +0200
Re: [PATCH v2] Input: elan_i2c - check if device is there before really probing Fabio Estevam <festevam@gmail.com> - 2017-05-09 03:50 +0200
Re: [PATCH v2] Input: elan_i2c - check if device is there before really probing Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-05-10 02:50 +0200
Re: [PATCH v2] Input: elan_i2c - check if device is there before really probing Fabio Estevam <festevam@gmail.com> - 2017-05-10 03:00 +0200
csiph-web