All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Biju Das <biju.das.au@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH] iio: adc: ltc2497: Simplify probe()
Date: Sun, 3 Sep 2023 13:06:39 +0100	[thread overview]
Message-ID: <20230903130639.1be1cf8c@jic23-huawei> (raw)
In-Reply-To: <20230902170529.62297-1-biju.das.jz@bp.renesas.com>

On Sat,  2 Sep 2023 18:05:29 +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 to the togreg branch of iio.git and pushed out testing.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/ltc2497.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/adc/ltc2497.c b/drivers/iio/adc/ltc2497.c
> index 5bdd40729611..6401a7727c31 100644
> --- a/drivers/iio/adc/ltc2497.c
> +++ b/drivers/iio/adc/ltc2497.c
> @@ -95,7 +95,6 @@ static int ltc2497_result_and_measure(struct ltc2497core_driverdata *ddata,
>  
>  static int ltc2497_probe(struct i2c_client *client)
>  {
> -	const struct i2c_device_id *id = i2c_client_get_device_id(client);
>  	const struct ltc2497_chip_info *chip_info;
>  	struct iio_dev *indio_dev;
>  	struct ltc2497_driverdata *st;
> @@ -115,9 +114,7 @@ static int ltc2497_probe(struct i2c_client *client)
>  	st->client = client;
>  	st->common_ddata.result_and_measure = ltc2497_result_and_measure;
>  
> -	chip_info = device_get_match_data(dev);
> -	if (!chip_info)
> -		chip_info = (const struct ltc2497_chip_info *)id->driver_data;
> +	chip_info = i2c_get_match_data(client);
>  	st->common_ddata.chip_info = chip_info;
>  
>  	resolution = chip_info->resolution;


      reply	other threads:[~2023-09-03 12:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-02 17:05 [PATCH] iio: adc: ltc2497: Simplify probe() Biju Das
2023-09-03 12:06 ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230903130639.1be1cf8c@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=biju.das.au@gmail.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.