* [PATCH 0/4] Use i2c_get_match_data()
@ 2023-07-16 17:52 Biju Das
2023-07-16 17:52 ` [PATCH 1/4] iio: accel: adxl355: Simplify probe() Biju Das
` (3 more replies)
0 siblings, 4 replies; 15+ messages in thread
From: Biju Das @ 2023-07-16 17:52 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Biju Das, Lars-Peter Clausen, Michael Hennerich, Puranjay Mohan,
linux-iio, Geert Uytterhoeven, Prabhakar Mahadev Lad,
linux-renesas-soc
Use i2c_get_match_data() to get match data for I2C, ACPI and
DT-based matching.
This patch series is only compile tested.
Biju Das (4):
iio: accel: adxl355: Simplify probe()
iio: accel: adxl313: Use i2c_get_match_data
iio: potentiometer: mcp4531: Use i2c_get_match_data
iio: potentiometer: mcp4018: Use i2c_get_match_data
drivers/iio/accel/adxl313_i2c.c | 4 ++--
drivers/iio/accel/adxl355_i2c.c | 15 +++------------
drivers/iio/potentiometer/mcp4018.c | 4 ++--
drivers/iio/potentiometer/mcp4531.c | 4 ++--
4 files changed, 9 insertions(+), 18 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH 1/4] iio: accel: adxl355: Simplify probe() 2023-07-16 17:52 [PATCH 0/4] Use i2c_get_match_data() Biju Das @ 2023-07-16 17:52 ` Biju Das 2023-07-17 8:10 ` Geert Uytterhoeven ` (2 more replies) 2023-07-16 17:52 ` [PATCH 2/4] iio: accel: adxl313: Use i2c_get_match_data Biju Das ` (2 subsequent siblings) 3 siblings, 3 replies; 15+ messages in thread From: Biju Das @ 2023-07-16 17:52 UTC (permalink / raw) To: Jonathan Cameron Cc: Biju Das, Lars-Peter Clausen, Michael Hennerich, Puranjay Mohan, linux-iio, Geert Uytterhoeven, Prabhakar Mahadev Lad, linux-renesas-soc Simplify the probe() by replacing of_device_get_match_data() and i2c_match_id() by i2c_get_match_data() as we have similar I2C and DT-based matching table. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> --- drivers/iio/accel/adxl355_i2c.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/iio/accel/adxl355_i2c.c b/drivers/iio/accel/adxl355_i2c.c index d5beea61479d..32398cde9608 100644 --- a/drivers/iio/accel/adxl355_i2c.c +++ b/drivers/iio/accel/adxl355_i2c.c @@ -24,19 +24,10 @@ static int adxl355_i2c_probe(struct i2c_client *client) { struct regmap *regmap; const struct adxl355_chip_info *chip_data; - const struct i2c_device_id *adxl355; - chip_data = device_get_match_data(&client->dev); - if (!chip_data) { - adxl355 = to_i2c_driver(client->dev.driver)->id_table; - if (!adxl355) - return -EINVAL; - - chip_data = (void *)i2c_match_id(adxl355, client)->driver_data; - - if (!chip_data) - return -EINVAL; - } + chip_data = i2c_get_match_data(client); + if (!chip_data) + return -ENODEV; regmap = devm_regmap_init_i2c(client, &adxl355_i2c_regmap_config); if (IS_ERR(regmap)) { -- 2.25.1 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 1/4] iio: accel: adxl355: Simplify probe() 2023-07-16 17:52 ` [PATCH 1/4] iio: accel: adxl355: Simplify probe() Biju Das @ 2023-07-17 8:10 ` Geert Uytterhoeven 2023-07-17 8:15 ` Puranjay Mohan 2023-07-22 16:25 ` Jonathan Cameron 2 siblings, 0 replies; 15+ messages in thread From: Geert Uytterhoeven @ 2023-07-17 8:10 UTC (permalink / raw) To: Biju Das Cc: Jonathan Cameron, Lars-Peter Clausen, Michael Hennerich, Puranjay Mohan, linux-iio, Geert Uytterhoeven, Prabhakar Mahadev Lad, linux-renesas-soc On Sun, Jul 16, 2023 at 7:52 PM Biju Das <biju.das.jz@bp.renesas.com> wrote: > Simplify the probe() by replacing of_device_get_match_data() and > i2c_match_id() by i2c_get_match_data() as we have similar I2C > and DT-based matching table. > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/4] iio: accel: adxl355: Simplify probe() 2023-07-16 17:52 ` [PATCH 1/4] iio: accel: adxl355: Simplify probe() Biju Das 2023-07-17 8:10 ` Geert Uytterhoeven @ 2023-07-17 8:15 ` Puranjay Mohan 2023-07-22 16:25 ` Jonathan Cameron 2 siblings, 0 replies; 15+ messages in thread From: Puranjay Mohan @ 2023-07-17 8:15 UTC (permalink / raw) To: Biju Das Cc: Jonathan Cameron, Lars-Peter Clausen, Michael Hennerich, linux-iio, Geert Uytterhoeven, Prabhakar Mahadev Lad, linux-renesas-soc On Sun, Jul 16, 2023 at 7:52 PM Biju Das <biju.das.jz@bp.renesas.com> wrote: > > Simplify the probe() by replacing of_device_get_match_data() and > i2c_match_id() by i2c_get_match_data() as we have similar I2C > and DT-based matching table. > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> > --- > drivers/iio/accel/adxl355_i2c.c | 15 +++------------ > 1 file changed, 3 insertions(+), 12 deletions(-) > > diff --git a/drivers/iio/accel/adxl355_i2c.c b/drivers/iio/accel/adxl355_i2c.c > index d5beea61479d..32398cde9608 100644 > --- a/drivers/iio/accel/adxl355_i2c.c > +++ b/drivers/iio/accel/adxl355_i2c.c > @@ -24,19 +24,10 @@ static int adxl355_i2c_probe(struct i2c_client *client) > { > struct regmap *regmap; > const struct adxl355_chip_info *chip_data; > - const struct i2c_device_id *adxl355; > > - chip_data = device_get_match_data(&client->dev); > - if (!chip_data) { > - adxl355 = to_i2c_driver(client->dev.driver)->id_table; > - if (!adxl355) > - return -EINVAL; > - > - chip_data = (void *)i2c_match_id(adxl355, client)->driver_data; > - > - if (!chip_data) > - return -EINVAL; > - } > + chip_data = i2c_get_match_data(client); > + if (!chip_data) > + return -ENODEV; > > regmap = devm_regmap_init_i2c(client, &adxl355_i2c_regmap_config); > if (IS_ERR(regmap)) { > -- > 2.25.1 > Reviewed-by: Puranjay Mohan <puranjay12@gmail.com> ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/4] iio: accel: adxl355: Simplify probe() 2023-07-16 17:52 ` [PATCH 1/4] iio: accel: adxl355: Simplify probe() Biju Das 2023-07-17 8:10 ` Geert Uytterhoeven 2023-07-17 8:15 ` Puranjay Mohan @ 2023-07-22 16:25 ` Jonathan Cameron 2 siblings, 0 replies; 15+ messages in thread From: Jonathan Cameron @ 2023-07-22 16:25 UTC (permalink / raw) To: Biju Das Cc: Lars-Peter Clausen, Michael Hennerich, Puranjay Mohan, linux-iio, Geert Uytterhoeven, Prabhakar Mahadev Lad, linux-renesas-soc On Sun, 16 Jul 2023 18:52:15 +0100 Biju Das <biju.das.jz@bp.renesas.com> wrote: > Simplify the probe() by replacing of_device_get_match_data() and > i2c_match_id() by i2c_get_match_data() as we have similar I2C > and DT-based matching table. > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Applied to the togreg branch of iio.git, initially pushed out as testing for 0-day to take a look at. Thanks, Jonathan > --- > drivers/iio/accel/adxl355_i2c.c | 15 +++------------ > 1 file changed, 3 insertions(+), 12 deletions(-) > > diff --git a/drivers/iio/accel/adxl355_i2c.c b/drivers/iio/accel/adxl355_i2c.c > index d5beea61479d..32398cde9608 100644 > --- a/drivers/iio/accel/adxl355_i2c.c > +++ b/drivers/iio/accel/adxl355_i2c.c > @@ -24,19 +24,10 @@ static int adxl355_i2c_probe(struct i2c_client *client) > { > struct regmap *regmap; > const struct adxl355_chip_info *chip_data; > - const struct i2c_device_id *adxl355; > > - chip_data = device_get_match_data(&client->dev); > - if (!chip_data) { > - adxl355 = to_i2c_driver(client->dev.driver)->id_table; > - if (!adxl355) > - return -EINVAL; > - > - chip_data = (void *)i2c_match_id(adxl355, client)->driver_data; > - > - if (!chip_data) > - return -EINVAL; > - } > + chip_data = i2c_get_match_data(client); > + if (!chip_data) > + return -ENODEV; > > regmap = devm_regmap_init_i2c(client, &adxl355_i2c_regmap_config); > if (IS_ERR(regmap)) { ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 2/4] iio: accel: adxl313: Use i2c_get_match_data 2023-07-16 17:52 [PATCH 0/4] Use i2c_get_match_data() Biju Das 2023-07-16 17:52 ` [PATCH 1/4] iio: accel: adxl355: Simplify probe() Biju Das @ 2023-07-16 17:52 ` Biju Das 2023-07-17 8:52 ` Geert Uytterhoeven 2023-07-22 16:28 ` Jonathan Cameron 2023-07-16 17:52 ` [PATCH 3/4] iio: potentiometer: mcp4531: " Biju Das 2023-07-16 17:52 ` [PATCH 4/4] iio: potentiometer: mcp4018: " Biju Das 3 siblings, 2 replies; 15+ messages in thread From: Biju Das @ 2023-07-16 17:52 UTC (permalink / raw) To: Jonathan Cameron Cc: Biju Das, Lars-Peter Clausen, Michael Hennerich, Lucas Stankus, linux-iio, Geert Uytterhoeven, Prabhakar Mahadev Lad, linux-renesas-soc Replace of_device_get_match_data() and i2c_match_id() by i2c_get_match _data() as we have similar I2C and DT-based matching table. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> --- drivers/iio/accel/adxl313_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/accel/adxl313_i2c.c b/drivers/iio/accel/adxl313_i2c.c index 524327ea3663..6d252190207b 100644 --- a/drivers/iio/accel/adxl313_i2c.c +++ b/drivers/iio/accel/adxl313_i2c.c @@ -65,9 +65,9 @@ static int adxl313_i2c_probe(struct i2c_client *client) * Retrieves device specific data as a pointer to a * adxl313_chip_info structure */ - chip_data = device_get_match_data(&client->dev); + chip_data = i2c_get_match_data(client); if (!chip_data) - chip_data = (const struct adxl313_chip_info *)i2c_match_id(adxl313_i2c_id, client)->driver_data; + return -ENODEV; regmap = devm_regmap_init_i2c(client, &adxl31x_i2c_regmap_config[chip_data->type]); -- 2.25.1 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 2/4] iio: accel: adxl313: Use i2c_get_match_data 2023-07-16 17:52 ` [PATCH 2/4] iio: accel: adxl313: Use i2c_get_match_data Biju Das @ 2023-07-17 8:52 ` Geert Uytterhoeven 2023-07-22 16:28 ` Jonathan Cameron 1 sibling, 0 replies; 15+ messages in thread From: Geert Uytterhoeven @ 2023-07-17 8:52 UTC (permalink / raw) To: Biju Das Cc: Jonathan Cameron, Lars-Peter Clausen, Michael Hennerich, Lucas Stankus, linux-iio, Prabhakar Mahadev Lad, linux-renesas-soc On Sun, Jul 16, 2023 at 7:52 PM Biju Das <biju.das.jz@bp.renesas.com> wrote: > Replace of_device_get_match_data() and i2c_match_id() by i2c_get_match > _data() as we have similar I2C and DT-based matching table. > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/4] iio: accel: adxl313: Use i2c_get_match_data 2023-07-16 17:52 ` [PATCH 2/4] iio: accel: adxl313: Use i2c_get_match_data Biju Das 2023-07-17 8:52 ` Geert Uytterhoeven @ 2023-07-22 16:28 ` Jonathan Cameron 2023-07-22 17:37 ` Biju Das 1 sibling, 1 reply; 15+ messages in thread From: Jonathan Cameron @ 2023-07-22 16:28 UTC (permalink / raw) To: Biju Das Cc: Lars-Peter Clausen, Michael Hennerich, Lucas Stankus, linux-iio, Geert Uytterhoeven, Prabhakar Mahadev Lad, linux-renesas-soc On Sun, 16 Jul 2023 18:52:16 +0100 Biju Das <biju.das.jz@bp.renesas.com> wrote: > Replace of_device_get_match_data() and i2c_match_id() by i2c_get_match > _data() as we have similar I2C and DT-based matching table. > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> > --- > drivers/iio/accel/adxl313_i2c.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/accel/adxl313_i2c.c b/drivers/iio/accel/adxl313_i2c.c > index 524327ea3663..6d252190207b 100644 > --- a/drivers/iio/accel/adxl313_i2c.c > +++ b/drivers/iio/accel/adxl313_i2c.c > @@ -65,9 +65,9 @@ static int adxl313_i2c_probe(struct i2c_client *client) > * Retrieves device specific data as a pointer to a > * adxl313_chip_info structure > */ > - chip_data = device_get_match_data(&client->dev); > + chip_data = i2c_get_match_data(client); > if (!chip_data) > - chip_data = (const struct adxl313_chip_info *)i2c_match_id(adxl313_i2c_id, client)->driver_data; > + return -ENODEV; > > regmap = devm_regmap_init_i2c(client, > &adxl31x_i2c_regmap_config[chip_data->type]); This driver looks buggy: static const struct i2c_device_id adxl313_i2c_id[] = { { .name = "adxl312", .driver_data = (kernel_ulong_t)&adxl31x_chip_info[ADXL312] }, { .name = "adxl313", .driver_data = (kernel_ulong_t)&adxl31x_chip_info[ADXL312] }, { .name = "adxl314", .driver_data = (kernel_ulong_t)&adxl31x_chip_info[ADXL312] }, { } }; MODULE_DEVICE_TABLE(i2c, adxl313_i2c_id); static const struct of_device_id adxl313_of_match[] = { { .compatible = "adi,adxl312", .data = &adxl31x_chip_info[ADXL312] }, { .compatible = "adi,adxl313", .data = &adxl31x_chip_info[ADXL313] }, { .compatible = "adi,adxl314", .data = &adxl31x_chip_info[ADXL314] }, { } }; Odd that the i2c_device_id table always uses ADXL312 That would only have previously applied if we failed to match on the of one (which only happens in somewhat obscure cases) Can we fix that first then apply this cleanup on top? Thanks, Jonathan ^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: [PATCH 2/4] iio: accel: adxl313: Use i2c_get_match_data 2023-07-22 16:28 ` Jonathan Cameron @ 2023-07-22 17:37 ` Biju Das 0 siblings, 0 replies; 15+ messages in thread From: Biju Das @ 2023-07-22 17:37 UTC (permalink / raw) To: Jonathan Cameron Cc: Lars-Peter Clausen, Michael Hennerich, Lucas Stankus, linux-iio@vger.kernel.org, Geert Uytterhoeven, Prabhakar Mahadev Lad, linux-renesas-soc@vger.kernel.org Hi Jonathan Cameron, > -----Original Message----- > From: Jonathan Cameron <jic23@kernel.org> > Sent: Saturday, July 22, 2023 5:29 PM > To: Biju Das <biju.das.jz@bp.renesas.com> > Cc: Lars-Peter Clausen <lars@metafoo.de>; Michael Hennerich > <Michael.Hennerich@analog.com>; Lucas Stankus > <lucas.p.stankus@gmail.com>; linux-iio@vger.kernel.org; Geert > Uytterhoeven <geert+renesas@glider.be>; Prabhakar Mahadev Lad > <prabhakar.mahadev-lad.rj@bp.renesas.com>; linux-renesas- > soc@vger.kernel.org > Subject: Re: [PATCH 2/4] iio: accel: adxl313: Use i2c_get_match_data > > On Sun, 16 Jul 2023 18:52:16 +0100 > Biju Das <biju.das.jz@bp.renesas.com> wrote: > > > Replace of_device_get_match_data() and i2c_match_id() by i2c_get_match > > _data() as we have similar I2C and DT-based matching table. > > > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> > > --- > > drivers/iio/accel/adxl313_i2c.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/iio/accel/adxl313_i2c.c > > b/drivers/iio/accel/adxl313_i2c.c index 524327ea3663..6d252190207b > > 100644 > > --- a/drivers/iio/accel/adxl313_i2c.c > > +++ b/drivers/iio/accel/adxl313_i2c.c > > @@ -65,9 +65,9 @@ static int adxl313_i2c_probe(struct i2c_client > *client) > > * Retrieves device specific data as a pointer to a > > * adxl313_chip_info structure > > */ > > - chip_data = device_get_match_data(&client->dev); > > + chip_data = i2c_get_match_data(client); > > if (!chip_data) > > - chip_data = (const struct adxl313_chip_info > *)i2c_match_id(adxl313_i2c_id, client)->driver_data; > > + return -ENODEV; > > > > regmap = devm_regmap_init_i2c(client, > > &adxl31x_i2c_regmap_config[chip_data- > >type]); > > This driver looks buggy: > > static const struct i2c_device_id adxl313_i2c_id[] = { > { .name = "adxl312", .driver_data = > (kernel_ulong_t)&adxl31x_chip_info[ADXL312] }, > { .name = "adxl313", .driver_data = > (kernel_ulong_t)&adxl31x_chip_info[ADXL312] }, > { .name = "adxl314", .driver_data = > (kernel_ulong_t)&adxl31x_chip_info[ADXL312] }, > { } > }; > > MODULE_DEVICE_TABLE(i2c, adxl313_i2c_id); > > static const struct of_device_id adxl313_of_match[] = { > { .compatible = "adi,adxl312", .data = &adxl31x_chip_info[ADXL312] > }, > { .compatible = "adi,adxl313", .data = &adxl31x_chip_info[ADXL313] > }, > { .compatible = "adi,adxl314", .data = &adxl31x_chip_info[ADXL314] > }, > { } > }; > > Odd that the i2c_device_id table always uses ADXL312 > > That would only have previously applied if we failed to match on the of > one (which only happens in somewhat obscure cases) > > Can we fix that first then apply this cleanup on top? Sure. Will send V2. Cheers, Biju ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 3/4] iio: potentiometer: mcp4531: Use i2c_get_match_data 2023-07-16 17:52 [PATCH 0/4] Use i2c_get_match_data() Biju Das 2023-07-16 17:52 ` [PATCH 1/4] iio: accel: adxl355: Simplify probe() Biju Das 2023-07-16 17:52 ` [PATCH 2/4] iio: accel: adxl313: Use i2c_get_match_data Biju Das @ 2023-07-16 17:52 ` Biju Das 2023-07-16 18:09 ` Biju Das 2023-07-16 17:52 ` [PATCH 4/4] iio: potentiometer: mcp4018: " Biju Das 3 siblings, 1 reply; 15+ messages in thread From: Biju Das @ 2023-07-16 17:52 UTC (permalink / raw) To: Peter Rosin, Jonathan Cameron Cc: Biju Das, Lars-Peter Clausen, linux-iio, Geert Uytterhoeven, Prabhakar Mahadev Lad, linux-renesas-soc Replace of_device_get_match_data() and i2c_match_id() by i2c_get_match _data() as we have similar I2C and DT-based matching table. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> --- drivers/iio/potentiometer/mcp4531.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/potentiometer/mcp4531.c b/drivers/iio/potentiometer/mcp4531.c index c513c00c8243..08e7af710e1f 100644 --- a/drivers/iio/potentiometer/mcp4531.c +++ b/drivers/iio/potentiometer/mcp4531.c @@ -368,9 +368,9 @@ static int mcp4531_probe(struct i2c_client *client) i2c_set_clientdata(client, indio_dev); data->client = client; - data->cfg = device_get_match_data(dev); + data->cfg = i2c_get_match_data(client); if (!data->cfg) - data->cfg = &mcp4531_cfg[i2c_match_id(mcp4531_id, client)->driver_data]; + return -ENODEV; indio_dev->info = &mcp4531_info; indio_dev->channels = mcp4531_channels; -- 2.25.1 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* RE: [PATCH 3/4] iio: potentiometer: mcp4531: Use i2c_get_match_data 2023-07-16 17:52 ` [PATCH 3/4] iio: potentiometer: mcp4531: " Biju Das @ 2023-07-16 18:09 ` Biju Das 0 siblings, 0 replies; 15+ messages in thread From: Biju Das @ 2023-07-16 18:09 UTC (permalink / raw) To: Peter Rosin, Jonathan Cameron Cc: Lars-Peter Clausen, linux-iio@vger.kernel.org, Geert Uytterhoeven, Prabhakar Mahadev Lad, linux-renesas-soc@vger.kernel.org Hi all, I would like to drop this patch, as this driver does not have similar I2C and DT-based matching table. Cheers, Biju > -----Original Message----- > From: Biju Das <biju.das.jz@bp.renesas.com> > Sent: Sunday, July 16, 2023 6:52 PM > To: Peter Rosin <peda@axentia.se>; Jonathan Cameron <jic23@kernel.org> > Cc: Biju Das <biju.das.jz@bp.renesas.com>; Lars-Peter Clausen > <lars@metafoo.de>; linux-iio@vger.kernel.org; Geert Uytterhoeven > <geert+renesas@glider.be>; Prabhakar Mahadev Lad <prabhakar.mahadev- > lad.rj@bp.renesas.com>; linux-renesas-soc@vger.kernel.org > Subject: [PATCH 3/4] iio: potentiometer: mcp4531: Use i2c_get_match_data > > Replace of_device_get_match_data() and i2c_match_id() by i2c_get_match > _data() as we have similar I2C and DT-based matching table. > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> > --- > drivers/iio/potentiometer/mcp4531.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/potentiometer/mcp4531.c > b/drivers/iio/potentiometer/mcp4531.c > index c513c00c8243..08e7af710e1f 100644 > --- a/drivers/iio/potentiometer/mcp4531.c > +++ b/drivers/iio/potentiometer/mcp4531.c > @@ -368,9 +368,9 @@ static int mcp4531_probe(struct i2c_client *client) > i2c_set_clientdata(client, indio_dev); > data->client = client; > > - data->cfg = device_get_match_data(dev); > + data->cfg = i2c_get_match_data(client); > if (!data->cfg) > - data->cfg = &mcp4531_cfg[i2c_match_id(mcp4531_id, client)- > >driver_data]; > + return -ENODEV; > > indio_dev->info = &mcp4531_info; > indio_dev->channels = mcp4531_channels; > -- > 2.25.1 ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 4/4] iio: potentiometer: mcp4018: Use i2c_get_match_data 2023-07-16 17:52 [PATCH 0/4] Use i2c_get_match_data() Biju Das ` (2 preceding siblings ...) 2023-07-16 17:52 ` [PATCH 3/4] iio: potentiometer: mcp4531: " Biju Das @ 2023-07-16 17:52 ` Biju Das 2023-07-16 18:10 ` Biju Das 3 siblings, 1 reply; 15+ messages in thread From: Biju Das @ 2023-07-16 17:52 UTC (permalink / raw) To: Peter Rosin, Jonathan Cameron Cc: Biju Das, Lars-Peter Clausen, linux-iio, Geert Uytterhoeven, Prabhakar Mahadev Lad, linux-renesas-soc Replace of_device_get_match_data() and i2c_match_id() by i2c_get_match _data() as we have similar I2C and DT-based matching table. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> --- drivers/iio/potentiometer/mcp4018.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/potentiometer/mcp4018.c b/drivers/iio/potentiometer/mcp4018.c index 89daecc90305..a5d902845a1c 100644 --- a/drivers/iio/potentiometer/mcp4018.c +++ b/drivers/iio/potentiometer/mcp4018.c @@ -157,9 +157,9 @@ static int mcp4018_probe(struct i2c_client *client) i2c_set_clientdata(client, indio_dev); data->client = client; - data->cfg = device_get_match_data(dev); + data->cfg = i2c_get_match_data(dev); if (!data->cfg) - data->cfg = &mcp4018_cfg[i2c_match_id(mcp4018_id, client)->driver_data]; + return -ENODEV; indio_dev->info = &mcp4018_info; indio_dev->channels = &mcp4018_channel; -- 2.25.1 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* RE: [PATCH 4/4] iio: potentiometer: mcp4018: Use i2c_get_match_data 2023-07-16 17:52 ` [PATCH 4/4] iio: potentiometer: mcp4018: " Biju Das @ 2023-07-16 18:10 ` Biju Das 2023-07-20 19:17 ` Jonathan Cameron 0 siblings, 1 reply; 15+ messages in thread From: Biju Das @ 2023-07-16 18:10 UTC (permalink / raw) To: Peter Rosin, Jonathan Cameron Cc: Lars-Peter Clausen, linux-iio@vger.kernel.org, Geert Uytterhoeven, Prabhakar Mahadev Lad, linux-renesas-soc@vger.kernel.org Hi All, I would like to drop this patch, as this driver does not have similar I2C and DT-based matching table. Cheers, Biju > -----Original Message----- > From: Biju Das <biju.das.jz@bp.renesas.com> > Sent: Sunday, July 16, 2023 6:52 PM > To: Peter Rosin <peda@axentia.se>; Jonathan Cameron <jic23@kernel.org> > Cc: Biju Das <biju.das.jz@bp.renesas.com>; Lars-Peter Clausen > <lars@metafoo.de>; linux-iio@vger.kernel.org; Geert Uytterhoeven > <geert+renesas@glider.be>; Prabhakar Mahadev Lad <prabhakar.mahadev- > lad.rj@bp.renesas.com>; linux-renesas-soc@vger.kernel.org > Subject: [PATCH 4/4] iio: potentiometer: mcp4018: Use i2c_get_match_data > > Replace of_device_get_match_data() and i2c_match_id() by i2c_get_match > _data() as we have similar I2C and DT-based matching table. > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> > --- > drivers/iio/potentiometer/mcp4018.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/potentiometer/mcp4018.c > b/drivers/iio/potentiometer/mcp4018.c > index 89daecc90305..a5d902845a1c 100644 > --- a/drivers/iio/potentiometer/mcp4018.c > +++ b/drivers/iio/potentiometer/mcp4018.c > @@ -157,9 +157,9 @@ static int mcp4018_probe(struct i2c_client *client) > i2c_set_clientdata(client, indio_dev); > data->client = client; > > - data->cfg = device_get_match_data(dev); > + data->cfg = i2c_get_match_data(dev); > if (!data->cfg) > - data->cfg = &mcp4018_cfg[i2c_match_id(mcp4018_id, client)- > >driver_data]; > + return -ENODEV; > > indio_dev->info = &mcp4018_info; > indio_dev->channels = &mcp4018_channel; > -- > 2.25.1 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 4/4] iio: potentiometer: mcp4018: Use i2c_get_match_data 2023-07-16 18:10 ` Biju Das @ 2023-07-20 19:17 ` Jonathan Cameron 2023-07-20 19:31 ` Biju Das 0 siblings, 1 reply; 15+ messages in thread From: Jonathan Cameron @ 2023-07-20 19:17 UTC (permalink / raw) To: Biju Das Cc: Peter Rosin, Lars-Peter Clausen, linux-iio@vger.kernel.org, Geert Uytterhoeven, Prabhakar Mahadev Lad, linux-renesas-soc@vger.kernel.org On Sun, 16 Jul 2023 18:10:13 +0000 Biju Das <biju.das.jz@bp.renesas.com> wrote: > Hi All, > > I would like to drop this patch, as this driver does not have similar > I2C and DT-based matching table. Could make it so they do ;) Jonathan > > Cheers, > Biju > > > -----Original Message----- > > From: Biju Das <biju.das.jz@bp.renesas.com> > > Sent: Sunday, July 16, 2023 6:52 PM > > To: Peter Rosin <peda@axentia.se>; Jonathan Cameron <jic23@kernel.org> > > Cc: Biju Das <biju.das.jz@bp.renesas.com>; Lars-Peter Clausen > > <lars@metafoo.de>; linux-iio@vger.kernel.org; Geert Uytterhoeven > > <geert+renesas@glider.be>; Prabhakar Mahadev Lad <prabhakar.mahadev- > > lad.rj@bp.renesas.com>; linux-renesas-soc@vger.kernel.org > > Subject: [PATCH 4/4] iio: potentiometer: mcp4018: Use i2c_get_match_data > > > > Replace of_device_get_match_data() and i2c_match_id() by i2c_get_match > > _data() as we have similar I2C and DT-based matching table. > > > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> > > --- > > drivers/iio/potentiometer/mcp4018.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/iio/potentiometer/mcp4018.c > > b/drivers/iio/potentiometer/mcp4018.c > > index 89daecc90305..a5d902845a1c 100644 > > --- a/drivers/iio/potentiometer/mcp4018.c > > +++ b/drivers/iio/potentiometer/mcp4018.c > > @@ -157,9 +157,9 @@ static int mcp4018_probe(struct i2c_client *client) > > i2c_set_clientdata(client, indio_dev); > > data->client = client; > > > > - data->cfg = device_get_match_data(dev); > > + data->cfg = i2c_get_match_data(dev); > > if (!data->cfg) > > - data->cfg = &mcp4018_cfg[i2c_match_id(mcp4018_id, client)- > > >driver_data]; > > + return -ENODEV; > > > > indio_dev->info = &mcp4018_info; > > indio_dev->channels = &mcp4018_channel; > > -- > > 2.25.1 > ^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: [PATCH 4/4] iio: potentiometer: mcp4018: Use i2c_get_match_data 2023-07-20 19:17 ` Jonathan Cameron @ 2023-07-20 19:31 ` Biju Das 0 siblings, 0 replies; 15+ messages in thread From: Biju Das @ 2023-07-20 19:31 UTC (permalink / raw) To: Jonathan Cameron Cc: Peter Rosin, Lars-Peter Clausen, linux-iio@vger.kernel.org, Geert Uytterhoeven, Prabhakar Mahadev Lad, linux-renesas-soc@vger.kernel.org Hi Jonathan Cameron, Thanks for the feedback. > -----Original Message----- > From: Jonathan Cameron <jic23@kernel.org> > Sent: Thursday, July 20, 2023 8:17 PM > To: Biju Das <biju.das.jz@bp.renesas.com> > Cc: Peter Rosin <peda@axentia.se>; Lars-Peter Clausen <lars@metafoo.de>; > linux-iio@vger.kernel.org; Geert Uytterhoeven <geert+renesas@glider.be>; > Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>; linux- > renesas-soc@vger.kernel.org > Subject: Re: [PATCH 4/4] iio: potentiometer: mcp4018: Use > i2c_get_match_data > > On Sun, 16 Jul 2023 18:10:13 +0000 > Biju Das <biju.das.jz@bp.renesas.com> wrote: > > > Hi All, > > > > I would like to drop this patch, as this driver does not have similar > > I2C and DT-based matching table. > > Could make it so they do ;) OK, will create separate patch for similar I2C and DT-based matching table and will send V2 for this driver. Cheers, Biju > > > > > Cheers, > > Biju > > > > > -----Original Message----- > > > From: Biju Das <biju.das.jz@bp.renesas.com> > > > Sent: Sunday, July 16, 2023 6:52 PM > > > To: Peter Rosin <peda@axentia.se>; Jonathan Cameron > > > <jic23@kernel.org> > > > Cc: Biju Das <biju.das.jz@bp.renesas.com>; Lars-Peter Clausen > > > <lars@metafoo.de>; linux-iio@vger.kernel.org; Geert Uytterhoeven > > > <geert+renesas@glider.be>; Prabhakar Mahadev Lad <prabhakar.mahadev- > > > lad.rj@bp.renesas.com>; linux-renesas-soc@vger.kernel.org > > > Subject: [PATCH 4/4] iio: potentiometer: mcp4018: Use > > > i2c_get_match_data > > > > > > Replace of_device_get_match_data() and i2c_match_id() by > > > i2c_get_match > > > _data() as we have similar I2C and DT-based matching table. > > > > > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> > > > --- > > > drivers/iio/potentiometer/mcp4018.c | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/iio/potentiometer/mcp4018.c > > > b/drivers/iio/potentiometer/mcp4018.c > > > index 89daecc90305..a5d902845a1c 100644 > > > --- a/drivers/iio/potentiometer/mcp4018.c > > > +++ b/drivers/iio/potentiometer/mcp4018.c > > > @@ -157,9 +157,9 @@ static int mcp4018_probe(struct i2c_client > *client) > > > i2c_set_clientdata(client, indio_dev); > > > data->client = client; > > > > > > - data->cfg = device_get_match_data(dev); > > > + data->cfg = i2c_get_match_data(dev); > > > if (!data->cfg) > > > - data->cfg = &mcp4018_cfg[i2c_match_id(mcp4018_id, client)- > > > >driver_data]; > > > + return -ENODEV; > > > > > > indio_dev->info = &mcp4018_info; > > > indio_dev->channels = &mcp4018_channel; > > > -- > > > 2.25.1 > > ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2023-07-22 17:37 UTC | newest] Thread overview: 15+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-07-16 17:52 [PATCH 0/4] Use i2c_get_match_data() Biju Das 2023-07-16 17:52 ` [PATCH 1/4] iio: accel: adxl355: Simplify probe() Biju Das 2023-07-17 8:10 ` Geert Uytterhoeven 2023-07-17 8:15 ` Puranjay Mohan 2023-07-22 16:25 ` Jonathan Cameron 2023-07-16 17:52 ` [PATCH 2/4] iio: accel: adxl313: Use i2c_get_match_data Biju Das 2023-07-17 8:52 ` Geert Uytterhoeven 2023-07-22 16:28 ` Jonathan Cameron 2023-07-22 17:37 ` Biju Das 2023-07-16 17:52 ` [PATCH 3/4] iio: potentiometer: mcp4531: " Biju Das 2023-07-16 18:09 ` Biju Das 2023-07-16 17:52 ` [PATCH 4/4] iio: potentiometer: mcp4018: " Biju Das 2023-07-16 18:10 ` Biju Das 2023-07-20 19:17 ` Jonathan Cameron 2023-07-20 19:31 ` Biju Das
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox