linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Baolin Wang <baolin.wang@linaro.org>
Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
	freeman.liu@unisoc.com, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org, orsonzhai@gmail.com,
	zhang.lyra@gmail.com
Subject: Re: [PATCH] iio: adc: sc27xx: Use devm_hwspin_lock_request_specific() to simplify code
Date: Sun, 6 Oct 2019 10:29:23 +0100	[thread overview]
Message-ID: <20191006102923.2d3e1b24@archlinux> (raw)
In-Reply-To: <dabc353394772cd27dc64b48278e2366a763269f.1569551672.git.baolin.wang@linaro.org>

On Fri, 27 Sep 2019 10:41:19 +0800
Baolin Wang <baolin.wang@linaro.org> wrote:

> Change to use devm_hwspin_lock_request_specific() to help to simplify the
> cleanup code for drivers requesting one hwlock.
> 
> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Applied to the togreg branch of iio.git and pushed out as testing for the
autobuilders to play with it.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/sc27xx_adc.c |   16 +---------------
>  1 file changed, 1 insertion(+), 15 deletions(-)
> 
> diff --git a/drivers/iio/adc/sc27xx_adc.c b/drivers/iio/adc/sc27xx_adc.c
> index a6c0465..66b387f 100644
> --- a/drivers/iio/adc/sc27xx_adc.c
> +++ b/drivers/iio/adc/sc27xx_adc.c
> @@ -477,13 +477,6 @@ static void sc27xx_adc_disable(void *_data)
>  			   SC27XX_MODULE_ADC_EN, 0);
>  }
>  
> -static void sc27xx_adc_free_hwlock(void *_data)
> -{
> -	struct hwspinlock *hwlock = _data;
> -
> -	hwspin_lock_free(hwlock);
> -}
> -
>  static int sc27xx_adc_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
> @@ -520,19 +513,12 @@ static int sc27xx_adc_probe(struct platform_device *pdev)
>  		return ret;
>  	}
>  
> -	sc27xx_data->hwlock = hwspin_lock_request_specific(ret);
> +	sc27xx_data->hwlock = devm_hwspin_lock_request_specific(dev, ret);
>  	if (!sc27xx_data->hwlock) {
>  		dev_err(dev, "failed to request hwspinlock\n");
>  		return -ENXIO;
>  	}
>  
> -	ret = devm_add_action_or_reset(dev, sc27xx_adc_free_hwlock,
> -			      sc27xx_data->hwlock);
> -	if (ret) {
> -		dev_err(dev, "failed to add hwspinlock action\n");
> -		return ret;
> -	}
> -
>  	sc27xx_data->dev = dev;
>  
>  	ret = sc27xx_adc_enable(sc27xx_data);


      reply	other threads:[~2019-10-06  9:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-27  2:41 [PATCH] iio: adc: sc27xx: Use devm_hwspin_lock_request_specific() to simplify code Baolin Wang
2019-10-06  9:29 ` 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=20191006102923.2d3e1b24@archlinux \
    --to=jic23@kernel.org \
    --cc=baolin.wang@linaro.org \
    --cc=freeman.liu@unisoc.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=pmeerw@pmeerw.net \
    --cc=zhang.lyra@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;
as well as URLs for NNTP newsgroup(s).