mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Lucas Stankus <lucas.p.stankus@gmail.com>,
	Michael.Hennerich@analog.com, jic23@kernel.org
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] iio: adc: ad7923: register device with devm_iio_device_register
Date: Mon, 29 Mar 2021 09:06:14 +0200	[thread overview]
Message-ID: <1548d948-bd01-a8db-6ecc-720bb7ca73a9@metafoo.de> (raw)
In-Reply-To: <b0146465d52f4e259f5f95c83c71e72f065093da.1616966903.git.lucas.p.stankus@gmail.com>

On 3/28/21 11:46 PM, Lucas Stankus wrote:
> Registers the device using the devm variant.
> This is the final step of converting the ad7923 to only use devm routines,
> meaning that the ad7923_remove() function is no longer needed to release
> resources on device detach.
> 
> Signed-off-by: Lucas Stankus <lucas.p.stankus@gmail.com>

Hi,

Thanks for the patches.T his looks good, just one small comment.

> ---
>   drivers/iio/adc/ad7923.c | 12 +-----------
>   1 file changed, 1 insertion(+), 11 deletions(-)
> 
> diff --git a/drivers/iio/adc/ad7923.c b/drivers/iio/adc/ad7923.c
> index d07eaf3111ed..f7af2f194789 100644
> --- a/drivers/iio/adc/ad7923.c
> +++ b/drivers/iio/adc/ad7923.c
> @@ -356,16 +356,7 @@ static int ad7923_probe(struct spi_device *spi)
>   	if (ret)
>   		return ret;
>   
> -	return iio_device_register(indio_dev);
> -}
> -
> -static int ad7923_remove(struct spi_device *spi)
> -{
> -	struct iio_dev *indio_dev = spi_get_drvdata(spi);

This removes the last user of get_drvdata() on the SPI device. This means you 
can also remove the spi_set_drvdata() in the probe function.

> -
> -	iio_device_unregister(indio_dev);
> -
> -	return 0;
> +	return devm_iio_device_register(&spi->dev, indio_dev);
>   }

  reply	other threads:[~2021-03-29  7:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-28 21:45 [PATCH 0/3] iio: adc: ad7923: convert driver resources routines to device-managed counterparts Lucas Stankus
2021-03-28 21:46 ` [PATCH 1/3] iio: adc: ad7923: use devm_add_action_or_reset for regulator disable Lucas Stankus
2021-03-28 21:46 ` [PATCH 2/3] iio: adc: ad7923: use device-managed function for triggered buffer Lucas Stankus
2021-03-28 21:46 ` [PATCH 3/3] iio: adc: ad7923: register device with devm_iio_device_register Lucas Stankus
2021-03-29  7:06   ` Lars-Peter Clausen [this message]
2021-03-29 11:18     ` Jonathan Cameron
2021-03-29  7:18 ` [PATCH 0/3] iio: adc: ad7923: convert driver resources routines to device-managed counterparts Alexandru Ardelean

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=1548d948-bd01-a8db-6ecc-720bb7ca73a9@metafoo.de \
    --to=lars@metafoo.de \
    --cc=Michael.Hennerich@analog.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.p.stankus@gmail.com \
    /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®