All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: "Nuno Sá" <nuno.sa@analog.com>
Cc: <linux-iio@vger.kernel.org>, <devel@driverdev.osuosl.org>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Dragos Bogdan <dragos.bogdan@analog.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	Alexandru Ardelean --dry-run <alexandru.ardelean@analog.com>
Subject: Re: [PATCH 07/10] iio: adis16480: Use Managed device functions
Date: Tue, 15 Sep 2020 11:07:45 +0100	[thread overview]
Message-ID: <20200915110745.00007a9c@Huawei.com> (raw)
In-Reply-To: <20200915093345.85614-8-nuno.sa@analog.com>

On Tue, 15 Sep 2020 11:33:42 +0200
Nuno Sá <nuno.sa@analog.com> wrote:

> Use the adis managed device functions to setup the buffer and the trigger.
> The ultimate goal will be to completely drop the non devm version from
> the lib.
> 
> Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> ---
>  drivers/iio/imu/adis16480.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c
> index 1eb4f98076f1..b6a129a70d4b 100644
> --- a/drivers/iio/imu/adis16480.c
> +++ b/drivers/iio/imu/adis16480.c
> @@ -1264,20 +1264,18 @@ static int adis16480_probe(struct spi_device *spi)
>  		st->clk_freq = st->chip_info->int_clk;
>  	}
>  
> -	ret = adis_setup_buffer_and_trigger(&st->adis, indio_dev, NULL);
> +	ret = devm_adis_setup_buffer_and_trigger(&st->adis, indio_dev, NULL);
>  	if (ret)
>  		goto error_clk_disable_unprepare;
>  
>  	ret = iio_device_register(indio_dev);
>  	if (ret)
> -		goto error_cleanup_buffer;
> +		goto error_clk_disable_unprepare;
>  
>  	adis16480_debugfs_init(indio_dev);
>  
>  	return 0;
>  
> -error_cleanup_buffer:
> -	adis_cleanup_buffer_and_trigger(&st->adis, indio_dev);
>  error_clk_disable_unprepare:
>  	clk_disable_unprepare(st->ext_clk);
>  error_stop_device:
> @@ -1293,7 +1291,6 @@ static int adis16480_remove(struct spi_device *spi)
>  	iio_device_unregister(indio_dev);
>  	adis16480_stop_device(indio_dev);
>  
> -	adis_cleanup_buffer_and_trigger(&st->adis, indio_dev);
This change the remove order so that it will not be a reverse of the order
seen in probe.   Perhaps you can solve that by using
devm_add_action_or_reset() calls to handle the few other remaining things
in remove?

Thanks,

Jonathan

>  	clk_disable_unprepare(st->ext_clk);
>  
>  	return 0;



  reply	other threads:[~2020-09-15 10:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15  9:33 [PATCH 00/10] Use ADIS devm functions for trigger/buffer setup Nuno Sá
2020-09-15  9:33 ` [PATCH 01/10] iio: adis16201: Use Managed device functions Nuno Sá
2020-09-15 10:05   ` Jonathan Cameron
2020-09-15  9:33 ` [PATCH 02/10] iio: adis16209: " Nuno Sá
2020-09-15  9:33 ` [PATCH 03/10] iio: adis16136: " Nuno Sá
2020-09-15 10:06   ` Jonathan Cameron
2020-09-15  9:33 ` [PATCH 04/10] iio: adis16260: " Nuno Sá
2020-09-15  9:33 ` [PATCH 05/10] iio: adis16400: " Nuno Sá
2020-09-15  9:33 ` [PATCH 06/10] iio: adis16460: " Nuno Sá
2020-09-15  9:33 ` [PATCH 07/10] iio: adis16480: " Nuno Sá
2020-09-15 10:07   ` Jonathan Cameron [this message]
2020-09-15  9:33 ` [PATCH 08/10] staging: iio: adis16203: " Nuno Sá
2020-09-15  9:33 ` [PATCH 09/10] staging: iio: adis16240: " Nuno Sá
2020-09-15  9:33 ` [PATCH 10/10] iio: adis: Drop non " Nuno Sá
2020-09-15 10:10   ` Jonathan Cameron
2020-09-15 10:20     ` Sa, Nuno
2020-09-15 10:26       ` 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=20200915110745.00007a9c@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=alexandru.ardelean@analog.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dragos.bogdan@analog.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --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 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.