linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Alexandru Ardelean <aardelean@deviqon.com>
Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: gyro: adis16080: use devm_iio_device_register() in probe
Date: Sat, 18 Sep 2021 19:07:21 +0100	[thread overview]
Message-ID: <20210918190721.58d3aa44@jic23-huawei> (raw)
In-Reply-To: <20210913115308.301877-1-aardelean@deviqon.com>

On Mon, 13 Sep 2021 14:53:08 +0300
Alexandru Ardelean <aardelean@deviqon.com> wrote:

> There is nothing else that needs to be done for this driver. The remove
> hook calls only the iio_device_unregister() hook.
> 
> So this driver can use devm_iio_device_register() directly.
> 
> Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
huh?  How did we end up with this one being so nearly done.
I guess maybe it predates devm_iio_device_register()!

Applied to the togreg branch of iio.git and pushed out as testing for
0-day to waste time testing it for us ;)

Thanks,

Jonathan

> ---
>  drivers/iio/gyro/adis16080.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/drivers/iio/gyro/adis16080.c b/drivers/iio/gyro/adis16080.c
> index e2f4d943e220..acef59d822b1 100644
> --- a/drivers/iio/gyro/adis16080.c
> +++ b/drivers/iio/gyro/adis16080.c
> @@ -195,8 +195,6 @@ static int adis16080_probe(struct spi_device *spi)
>  	if (!indio_dev)
>  		return -ENOMEM;
>  	st = iio_priv(indio_dev);
> -	/* this is only used for removal purposes */
> -	spi_set_drvdata(spi, indio_dev);
>  
>  	mutex_init(&st->lock);
>  
> @@ -210,13 +208,7 @@ static int adis16080_probe(struct spi_device *spi)
>  	indio_dev->info = &adis16080_info;
>  	indio_dev->modes = INDIO_DIRECT_MODE;
>  
> -	return iio_device_register(indio_dev);
> -}
> -
> -static int adis16080_remove(struct spi_device *spi)
> -{
> -	iio_device_unregister(spi_get_drvdata(spi));
> -	return 0;
> +	return devm_iio_device_register(&spi->dev, indio_dev);
>  }
>  
>  static const struct spi_device_id adis16080_ids[] = {
> @@ -231,7 +223,6 @@ static struct spi_driver adis16080_driver = {
>  		.name = "adis16080",
>  	},
>  	.probe = adis16080_probe,
> -	.remove = adis16080_remove,
>  	.id_table = adis16080_ids,
>  };
>  module_spi_driver(adis16080_driver);


      reply	other threads:[~2021-09-18 18:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 11:53 [PATCH] iio: gyro: adis16080: use devm_iio_device_register() in probe Alexandru Ardelean
2021-09-18 18:07 ` 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=20210918190721.58d3aa44@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=aardelean@deviqon.com \
    --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;
as well as URLs for NNTP newsgroup(s).