From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 In-Reply-To: References: <1514556006-23293-1-git-send-email-mastichi@gmail.com> <20171229175449.760e734d@archlinux> <20180101095342.4d4d5325@archlinux> <20180106131434.550e8e42@archlinux> <20180107160820.05660804@archlinux> From: Dmitry Mastykin Date: Tue, 9 Jan 2018 23:46:14 +0300 Message-ID: Subject: Re: [PATCH v2] iio: adc: max9611: fix module auto-loading To: Jonathan Cameron Cc: Andy Shevchenko , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Jacopo Mondi , Dan Carpenter , Rob Herring , "linux-iio@vger.kernel.org" , Linux Kernel Mailing List Content-Type: multipart/alternative; boundary="001a1148e4fc85ea6d05625e0131" List-ID: --001a1148e4fc85ea6d05625e0131 Content-Type: text/plain; charset="UTF-8" Hello Johnatan, I think the issue is the same as Javier Martinez Canillas wrote: "What is not correct is to require OF-only drivers to have an I2C device ID table just as a workaround to have their modules auto-loading working." Please see: http://lkml.iu.edu/hypermail/linux/kernel/1712.0/01779.html So the problem is not in driver, but in auto-loading procedure. Kind regards, Dmitry >> >> >> >> > Signed-off-by: Dmitry Mastykin > > >> >> >> >> > --- > >> >> >> >> > 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 > >> >> >> >> > > >> >> > > >> > > >> -- > >> To unsubscribe from this list: send the line "unsubscribe linux-iio" in > >> the body of a message to majordomo@vger.kernel.org > >> More majordomo info at http://vger.kernel.org/majordomo-info.html > > > --001a1148e4fc85ea6d05625e0131 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Johnatan,
I think the issue is the same as Javier Martinez Canill= as wrote:
"What is not correct is to require OF-only dr= ivers to have an I2C
device ID table just as a workaround to have= their modules auto-loading working."
Please see: http://lkml.iu.edu= /hypermail/linux/kernel/1712.0/01779.html
So the problem is n= ot in driver, but in auto-loading procedure.

Kind = regards,
Dmitry



>> >> >> >> &= gt; Signed-off-by: Dmitry Mastykin <mastichi@gmail.com>
>> >> >> >> > ---
>> >> >> >> >=C2=A0 drivers/iio/adc/max9611.c | = 5 ++---
>> >> >> >> >=C2=A0 1 file changed, 2 insertions= (+), 3 deletions(-)
>> >> >> >> >
>> >> >> >> > diff --git a/drivers/iio/adc/max96= 11.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 s= truct of_device_id max9611_of_table[] =3D {
>> >> >> >> >=C2=A0 };
>> >> >> >> >
>> >> >> >> >=C2=A0 MODULE_DEVICE_TABLE(of, max9= 611_of_table);
>> >> >> >> > -static int max9611_probe(struct i= 2c_client *client,
>> >> >> >> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 const struct i2c_devic= e_id *id)
>> >> >> >> > +static int max9611_probe(struct i= 2c_client *client)
>> >> >> >> >=C2=A0 {
>> >> >> >> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0c= onst char * const shunt_res_prop =3D "shunt-resistor-micro-ohms";=
>> >> >> >> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0c= onst struct device_node *of_node =3D client->dev.of_node;
>> >> >> >> > @@ -576,7 +575,7 @@ static struct = i2c_driver max9611_driver =3D {
>> >> >> >> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .owner =3D THIS_MODULE,
>> >> >> >> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .of_match_table =3D max9611_of_table, >> >> >> >> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}= ,
>> >> >> >> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0.probe= =3D max9611_probe,
>> >> >> >> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0.probe= _new =3D max9611_probe,
>> >> >> >> >=C2=A0 };
>> >> >> >> >=C2=A0 module_i2c_driver(max9611_driver);
>> >> >> >> >
>> >> >> >> > --
>> >> >> >> > 2.7.4
>> >> >> >> >
>> >> >
>> >
>> --
>> To unsubscribe from this list: send the line "unsubscribe lin= ux-iio" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at=C2=A0 http://vger.kernel.org/majordomo-i= nfo.html
>
--001a1148e4fc85ea6d05625e0131--