Re: [RFC PATCH 4/5] w1: add a callback to call slave when a new device is connected

From: Antoine Tenart
Date: Wed Oct 26 2016 - 13:30:21 EST


Hello Mathieu,

On Wed, Oct 26, 2016 at 10:42:28AM -0600, Mathieu Poirier wrote:
> On 26 October 2016 at 08:57, Antoine Tenart
> <antoine.tenart@xxxxxxxxxxxxxxxxxx> wrote:
> > }
> > + if (fops->callback) {
> > + err = fops->callback(sl);
> > + /*
> > + * Do not return an error as the slave driver correctly
> > + * probed.
> > + */
>
> I don't get this part. What's the point of calling a callback if a
> failure is not important - maybe I'm just missing something.
>
> > + if (err)
> > + dev_err(&sl->dev,
> > + "callback call failed. err=%d\n", err);
> > + }

In our case it can be not that important: if we fail to apply an
overlay, we can still use the w1 interfaces to access the eeprom.

Anyway, all those errors weren't taken into account by the w1 framework
before (see my other patch). Also, the w1 patches are given for the
example and could be improved. Part of the reason is the w1 framework
itself :-)

Antoine

--
Antoine Ténart, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

Attachment: signature.asc
Description: PGP signature