public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Alexandru Ardelean <aardelean@deviqon.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org, jic23@kernel.org, hdegoede@redhat.com,
	wens@csie.org
Subject: Re: [PATCH 2/5] iio: adc: intel_mrfld_adc: convert probe to full device-managed
Date: Fri, 3 Sep 2021 16:22:15 +0300	[thread overview]
Message-ID: <YTIhh7TkIo+mqIvA@smile.fi.intel.com> (raw)
In-Reply-To: <20210903072917.45769-3-aardelean@deviqon.com>

On Fri, Sep 03, 2021 at 10:29:14AM +0300, Alexandru Ardelean wrote:
> The only call in the remove hook is the iio_map_array_unregister() call.
> Since we have a devm_iio_map_array_register() function now, we can use that
> and remove the remove hook entirely.
> The IIO device was registered with the devm_iio_device_register() prior to
> this change.
> 
> Also, the platform_set_drvdata() can be removed now, since it was used only
> in the remove hook.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
> ---
>  drivers/iio/adc/intel_mrfld_adc.c | 24 ++----------------------
>  1 file changed, 2 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/iio/adc/intel_mrfld_adc.c b/drivers/iio/adc/intel_mrfld_adc.c
> index 75394350eb4c..616de0c3a049 100644
> --- a/drivers/iio/adc/intel_mrfld_adc.c
> +++ b/drivers/iio/adc/intel_mrfld_adc.c
> @@ -205,8 +205,6 @@ static int mrfld_adc_probe(struct platform_device *pdev)
>  	if (ret)
>  		return ret;
>  
> -	platform_set_drvdata(pdev, indio_dev);
> -
>  	indio_dev->name = pdev->name;
>  
>  	indio_dev->channels = mrfld_adc_channels;
> @@ -214,28 +212,11 @@ static int mrfld_adc_probe(struct platform_device *pdev)
>  	indio_dev->info = &mrfld_adc_iio_info;
>  	indio_dev->modes = INDIO_DIRECT_MODE;
>  
> -	ret = iio_map_array_register(indio_dev, iio_maps);
> +	ret = devm_iio_map_array_register(dev, indio_dev, iio_maps);
>  	if (ret)
>  		return ret;
>  
> -	ret = devm_iio_device_register(dev, indio_dev);
> -	if (ret < 0)
> -		goto err_array_unregister;
> -
> -	return 0;
> -
> -err_array_unregister:
> -	iio_map_array_unregister(indio_dev);
> -	return ret;
> -}
> -
> -static int mrfld_adc_remove(struct platform_device *pdev)
> -{
> -	struct iio_dev *indio_dev = platform_get_drvdata(pdev);
> -
> -	iio_map_array_unregister(indio_dev);
> -
> -	return 0;
> +	return devm_iio_device_register(dev, indio_dev);
>  }
>  
>  static const struct platform_device_id mrfld_adc_id_table[] = {
> @@ -249,7 +230,6 @@ static struct platform_driver mrfld_adc_driver = {
>  		.name = "mrfld_bcove_adc",
>  	},
>  	.probe = mrfld_adc_probe,
> -	.remove = mrfld_adc_remove,
>  	.id_table = mrfld_adc_id_table,
>  };
>  module_platform_driver(mrfld_adc_driver);
> -- 
> 2.31.1
> 

-- 
With Best Regards,
Andy Shevchenko



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

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-03  7:29 [PATCH 0/5] iio: device-managed conversions with devm_iio_map_array_register() Alexandru Ardelean
2021-09-03  7:29 ` [PATCH 1/5] iio: inkern: introduce devm_iio_map_array_register() short-hand function Alexandru Ardelean
2021-09-03 13:40   ` Andy Shevchenko
2021-09-03 13:56     ` Alexandru Ardelean
2021-09-05 11:08       ` Jonathan Cameron
2021-09-03  7:29 ` [PATCH 2/5] iio: adc: intel_mrfld_adc: convert probe to full device-managed Alexandru Ardelean
2021-09-03 13:22   ` Andy Shevchenko [this message]
2021-09-03  7:29 ` [PATCH 3/5] iio: adc: axp288_adc: " Alexandru Ardelean
2021-09-03  8:00   ` Hans de Goede
2021-09-03  7:29 ` [PATCH 4/5] iio: adc: lp8788_adc: convert probe to full-device managed Alexandru Ardelean
2021-09-03  7:29 ` [PATCH 5/5] iio: adc: da9150-gpadc: " Alexandru Ardelean
2021-09-26 15:20 ` [PATCH 0/5] iio: device-managed conversions with devm_iio_map_array_register() Jonathan Cameron

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=YTIhh7TkIo+mqIvA@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=aardelean@deviqon.com \
    --cc=hdegoede@redhat.com \
    --cc=jic23@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wens@csie.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