* [PATCH] iio: adc: ti-ads1015: Simplify probe()
@ 2023-09-02 16:32 Biju Das
2023-09-03 12:04 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Biju Das @ 2023-09-02 16:32 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Biju Das, Lars-Peter Clausen, Uwe Kleine-König,
Andy Shevchenko, linux-iio, linux-kernel, Biju Das
Simpilfy probe() by replacing device_get_match_data() and id lookup for
retrieving match data by using i2c_get_match_data().
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
drivers/iio/adc/ti-ads1015.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c
index 075c75a87544..9984515bfdea 100644
--- a/drivers/iio/adc/ti-ads1015.c
+++ b/drivers/iio/adc/ti-ads1015.c
@@ -976,16 +976,13 @@ static int ads1015_set_conv_mode(struct ads1015_data *data, int mode)
static int ads1015_probe(struct i2c_client *client)
{
- const struct i2c_device_id *id = i2c_client_get_device_id(client);
const struct ads1015_chip_data *chip;
struct iio_dev *indio_dev;
struct ads1015_data *data;
int ret;
int i;
- chip = device_get_match_data(&client->dev);
- if (!chip)
- chip = (const struct ads1015_chip_data *)id->driver_data;
+ chip = i2c_get_match_data(client);
if (!chip)
return dev_err_probe(&client->dev, -EINVAL, "Unknown chip\n");
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iio: adc: ti-ads1015: Simplify probe()
2023-09-02 16:32 [PATCH] iio: adc: ti-ads1015: Simplify probe() Biju Das
@ 2023-09-03 12:04 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2023-09-03 12:04 UTC (permalink / raw)
To: Biju Das
Cc: Lars-Peter Clausen, Uwe Kleine-König, Andy Shevchenko,
linux-iio, linux-kernel, Biju Das
On Sat, 2 Sep 2023 17:32:33 +0100
Biju Das <biju.das.jz@bp.renesas.com> wrote:
> Simpilfy probe() by replacing device_get_match_data() and id lookup for
> retrieving match data by using i2c_get_match_data().
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Applied.
> ---
> drivers/iio/adc/ti-ads1015.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c
> index 075c75a87544..9984515bfdea 100644
> --- a/drivers/iio/adc/ti-ads1015.c
> +++ b/drivers/iio/adc/ti-ads1015.c
> @@ -976,16 +976,13 @@ static int ads1015_set_conv_mode(struct ads1015_data *data, int mode)
>
> static int ads1015_probe(struct i2c_client *client)
> {
> - const struct i2c_device_id *id = i2c_client_get_device_id(client);
> const struct ads1015_chip_data *chip;
> struct iio_dev *indio_dev;
> struct ads1015_data *data;
> int ret;
> int i;
>
> - chip = device_get_match_data(&client->dev);
> - if (!chip)
> - chip = (const struct ads1015_chip_data *)id->driver_data;
> + chip = i2c_get_match_data(client);
> if (!chip)
> return dev_err_probe(&client->dev, -EINVAL, "Unknown chip\n");
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-03 12:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-02 16:32 [PATCH] iio: adc: ti-ads1015: Simplify probe() Biju Das
2023-09-03 12:04 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox