mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Alexandru Ardelean <aardelean@deviqon.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH v1 1/2] iio: adc: nau7802: Convert driver to use ->probe_new()
Date: Fri, 3 Jun 2022 18:35:42 +0100	[thread overview]
Message-ID: <20220603183542.3485d903@jic23-huawei> (raw)
In-Reply-To: <20220531213922.72992-1-andriy.shevchenko@linux.intel.com>

On Wed,  1 Jun 2022 00:39:21 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> Use the ->probe_new() callback.
> 
> The driver does not use const struct i2c_device_id * argument,
> so convert it to utilise the simplified I²C driver registration.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Series applied,

Thanks for all these cleanups btw.

Jonathan

> ---
>  drivers/iio/adc/nau7802.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/iio/adc/nau7802.c b/drivers/iio/adc/nau7802.c
> index 976c235f3079..2d71cdbcd82f 100644
> --- a/drivers/iio/adc/nau7802.c
> +++ b/drivers/iio/adc/nau7802.c
> @@ -407,8 +407,7 @@ static const struct iio_info nau7802_info = {
>  	.attrs = &nau7802_attribute_group,
>  };
>  
> -static int nau7802_probe(struct i2c_client *client,
> -			const struct i2c_device_id *id)
> +static int nau7802_probe(struct i2c_client *client)
>  {
>  	struct iio_dev *indio_dev;
>  	struct nau7802_state *st;
> @@ -417,11 +416,6 @@ static int nau7802_probe(struct i2c_client *client,
>  	u8 data;
>  	u32 tmp = 0;
>  
> -	if (!client->dev.of_node) {
> -		dev_err(&client->dev, "No device tree node available.\n");
> -		return -EINVAL;
> -	}
> -
>  	indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*st));
>  	if (indio_dev == NULL)
>  		return -ENOMEM;
> @@ -550,7 +544,7 @@ static const struct of_device_id nau7802_dt_ids[] = {
>  MODULE_DEVICE_TABLE(of, nau7802_dt_ids);
>  
>  static struct i2c_driver nau7802_driver = {
> -	.probe = nau7802_probe,
> +	.probe_new = nau7802_probe,
>  	.id_table = nau7802_i2c_id,
>  	.driver = {
>  		   .name = "nau7802",


      parent reply	other threads:[~2022-06-03 17:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31 21:39 Andy Shevchenko
2022-05-31 21:39 ` [PATCH v1 2/2] iio: adc: nau7802: Make use of device properties Andy Shevchenko
2022-06-03 17:35 ` 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=20220603183542.3485d903@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=aardelean@deviqon.com \
    --cc=andriy.shevchenko@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®