All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Hartmut Knaack <knaack.h@gmx.de>, linux-iio@vger.kernel.org
Subject: Re: [PATCH V2 2/2]staging:iio:ad799x fix error_free_irq, use devm_request_threaded_irq
Date: Sat, 15 Feb 2014 09:53:31 +0000	[thread overview]
Message-ID: <52FF391B.4030600@kernel.org> (raw)
In-Reply-To: <52C49EED.5000206@gmx.de>

On 01/01/14 23:04, Hartmut Knaack wrote:
> Move to devm_request_threaded_irq to make device-removal easier.
>
> Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Applied to the togreg branch of iio.git

I took the short description above and used it as the patch title as it
was more accurate after the patch split up.
> ---
> diff --git a/drivers/staging/iio/adc/ad799x_core.c b/drivers/staging/iio/adc/ad799x_core.c
> index 3deb390..bc886f6 100644
> --- a/drivers/staging/iio/adc/ad799x_core.c
> +++ b/drivers/staging/iio/adc/ad799x_core.c
> @@ -573,25 +573,23 @@ static int ad799x_probe(struct i2c_client *client,
>   		goto error_disable_reg;
>
>   	if (client->irq > 0) {
> -		ret = request_threaded_irq(client->irq,
> -					   NULL,
> -					   ad799x_event_handler,
> -					   IRQF_TRIGGER_FALLING |
> -					   IRQF_ONESHOT,
> -					   client->name,
> -					   indio_dev);
> +		ret = devm_request_threaded_irq(&client->dev,
> +						client->irq,
> +						NULL,
> +						ad799x_event_handler,
> +						IRQF_TRIGGER_FALLING |
> +						IRQF_ONESHOT,
> +						client->name,
> +						indio_dev);
>   		if (ret)
>   			goto error_cleanup_ring;
>   	}
>   	ret = iio_device_register(indio_dev);
>   	if (ret)
> -		goto error_free_irq;
> +		goto error_cleanup_ring;
>
>   	return 0;
>
> -error_free_irq:
> -	if (client->irq > 0)
> -		free_irq(client->irq, indio_dev);
>   error_cleanup_ring:
>   	ad799x_ring_cleanup(indio_dev);
>   error_disable_reg:
> @@ -607,8 +605,6 @@ static int ad799x_remove(struct i2c_client *client)
>   	struct ad799x_state *st = iio_priv(indio_dev);
>
>   	iio_device_unregister(indio_dev);
> -	if (client->irq > 0)
> -		free_irq(client->irq, indio_dev);
>
>   	ad799x_ring_cleanup(indio_dev);
>   	if (!IS_ERR(st->reg))
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


      parent reply	other threads:[~2014-02-15  9:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-01 23:04 [PATCH V2 2/2]staging:iio:ad799x fix error_free_irq, use devm_request_threaded_irq Hartmut Knaack
2014-01-05 16:05 ` Lars-Peter Clausen
2014-01-11 11:50   ` Jonathan Cameron
2014-02-15  9:53 ` 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=52FF391B.4030600@kernel.org \
    --to=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=linux-iio@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.