public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Chuhong Yuan <hslester96@gmail.com>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: max1027: fix not unregistered iio trigger
Date: Sat, 23 Nov 2019 16:29:21 +0000	[thread overview]
Message-ID: <20191123162921.71499b80@archlinux> (raw)
In-Reply-To: <20191118114018.25431-1-hslester96@gmail.com>

On Mon, 18 Nov 2019 19:40:18 +0800
Chuhong Yuan <hslester96@gmail.com> wrote:

> The driver forgets to unregister the iio trigger in probe failure and
> remove.
> Use devm API to fix it.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Hi.

This has crossed with some other patches to the driver, but the fix
is still applicable.  If we want to push this back to older stable
branches we will need to do manual backports.

Adjusted version applied to the fixes-togreg branch of iio.git.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/max1027.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c
> index 214883458582..8caead7dffa5 100644
> --- a/drivers/iio/adc/max1027.c
> +++ b/drivers/iio/adc/max1027.c
> @@ -446,7 +446,12 @@ static int max1027_probe(struct spi_device *spi)
>  	st->trig->ops = &max1027_trigger_ops;
>  	st->trig->dev.parent = &spi->dev;
>  	iio_trigger_set_drvdata(st->trig, indio_dev);
> -	iio_trigger_register(st->trig);
> +
> +	ret = devm_iio_trigger_register(&spi->dev, st->trig);
> +	if (ret < 0) {
> +		dev_err(&indio_dev->dev, "Failed to register iio trigger\n");
> +		return ret;
> +	}
>  
>  	ret = devm_request_threaded_irq(&spi->dev, spi->irq,
>  					iio_trigger_generic_data_rdy_poll,


      reply	other threads:[~2019-11-23 16:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-18 11:40 [PATCH] iio: adc: max1027: fix not unregistered iio trigger Chuhong Yuan
2019-11-23 16: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=20191123162921.71499b80@archlinux \
    --to=jic23@kernel.org \
    --cc=hslester96@gmail.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /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