lkml.org 
[lkml]   [2017]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] iio: adc: max9611: fix module auto-loading
> On Fri, 29 Dec 2017 17:30:39 +0200
> Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
>> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
>>
I was not aware of this tag, that's what I wanted to write, thanks!

On Fri, Dec 29, 2017 at 8:54 PM, Jonathan Cameron <jic23@kernel.org> wrote:
> I'm a little confused. Why does this now make module autoloading
> work where it previously didn't?
>
As I understand, .probe is not called if module doesn't export i2c id table,
there is nothing to put into second argument.
But .probe_new is called, because it's supposed to do of_match_device itself.

Kind regards,
Dmitry

>> > Signed-off-by: Dmitry Mastykin <mastichi@gmail.com>
>> > ---
>> > drivers/iio/adc/max9611.c | 5 ++---
>> > 1 file changed, 2 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/drivers/iio/adc/max9611.c b/drivers/iio/adc/max9611.c
>> > index b1dd17c..ce0115a 100644
>> > --- a/drivers/iio/adc/max9611.c
>> > +++ b/drivers/iio/adc/max9611.c
>> > @@ -523,8 +523,7 @@ static const struct of_device_id max9611_of_table[] = {
>> > };
>> >
>> > MODULE_DEVICE_TABLE(of, max9611_of_table);
>> > -static int max9611_probe(struct i2c_client *client,
>> > - const struct i2c_device_id *id)
>> > +static int max9611_probe(struct i2c_client *client)
>> > {
>> > const char * const shunt_res_prop = "shunt-resistor-micro-ohms";
>> > const struct device_node *of_node = client->dev.of_node;
>> > @@ -576,7 +575,7 @@ static struct i2c_driver max9611_driver = {
>> > .owner = THIS_MODULE,
>> > .of_match_table = max9611_of_table,
>> > },
>> > - .probe = max9611_probe,
>> > + .probe_new = max9611_probe,
>> > };
>> > module_i2c_driver(max9611_driver);
>> >
>> > --
>> > 2.7.4
>> >

\
 
 \ /
  Last update: 2017-12-30 13:44    [W:0.056 / U:0.092 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site