Re: [PATCH v6 2/2] mfd: syscon: Add non-DT support

From: Arnd Bergmann
Date: Mon Mar 11 2013 - 09:39:19 EST


On Monday 11 March 2013, Dong Aisheng wrote:
> > > > + dev = driver_find_device(&syscon_driver.driver, NULL, (void *)s,
> > > > + syscon_match_pdevname);
> > > > + if (!dev)
> > > > + return ERR_PTR(-ENODEV);
> > >
> > > Should it be ERR_PTR(-EPROBE_DEFER)?
> >
> > I have no idea what better using here. Think that is not so important
> > since we may have only one possible error code here.
>
> I'm not quite understand your meaning.
> Since the syscon device may be still not registered,
> so it may be better to return a EPROBE_DERFER which is the same
> as dt version.

I'm guessing that Alexander has not encountered deferred probing yet.
Alexander, the point here is that returning -EPROBE_DEFER has the
advantage that a probe() callback calling this function can
simply return that error code to the driver core. If the driver
core sees -EPROBE_DEFER, it will retry the same probe function
later, after all other device probe functions have been called
and at least one of them was successful. This way you can load the
syscon driver after loading a driver depending on it and everything
will still work.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/