public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Andrew Ijano" <andrew.ijano@gmail.com>,
	linux-iio@vger.kernel.org (open list:IIO SUBSYSTEM AND DRIVERS),
	linux-kernel@vger.kernel.org (open list),
	kernel-janitors@vger.kernel.org,
	"Andy Shevchenko" <andriy.shevchenko@intel.com>
Subject: Re: [PATCH next 3/4] iio: sca3000: manage device registration with devm helper
Date: Sat, 31 Jan 2026 16:32:18 +0000	[thread overview]
Message-ID: <20260131163218.2a4b93e5@jic23-huawei> (raw)
In-Reply-To: <20260130214323.236389-4-harshit.m.mogalapalli@oracle.com>

On Fri, 30 Jan 2026 13:43:10 -0800
Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> wrote:

> Convert the iio registration to use devm_* helpers so the probe no
> longer needs a separate cleanup path and remove callback can also drop
> the unregister.
> 
> No functional change intended.
> 
> Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>

This results in the order of two bits of tear down being reversed.
It might be your intent but if so you need a clear description of
why it is fine to do this and why it is not a functional change.

Jonathan

> ---
>  drivers/iio/accel/sca3000.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c
> index 0210c716cf38..bf1957c7bc77 100644
> --- a/drivers/iio/accel/sca3000.c
> +++ b/drivers/iio/accel/sca3000.c
> @@ -1489,11 +1489,7 @@ static int sca3000_probe(struct spi_device *spi)
>  	if (ret)
>  		return ret;
>  
> -	ret = iio_device_register(indio_dev);
> -	if (ret)
> -		return ret;
> -
> -	return 0;
> +	return devm_iio_device_register(dev, indio_dev);
>  }
>  
>  static int sca3000_stop_all_interrupts(struct sca3000_state *st)
> @@ -1519,8 +1515,6 @@ static void sca3000_remove(struct spi_device *spi)
>  	struct iio_dev *indio_dev = spi_get_drvdata(spi);
>  	struct sca3000_state *st = iio_priv(indio_dev);
>  
> -	iio_device_unregister(indio_dev);
> -
>  	/* Must ensure no interrupts can be generated after this! */
>  	sca3000_stop_all_interrupts(st);

This changes the ordering.  Now we stop interrupts before removing the
userspace interfaces.  You probably need to reorder this and the next
patch so there is no intermediate broken point.

>  }


  reply	other threads:[~2026-01-31 16:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-30 21:43 [PATCH next 0/4] IIO: sca3000: devm resource management Harshit Mogalapalli
2026-01-30 21:43 ` [PATCH next 1/4] iio: sca3000: cache SPI device ID in probe Harshit Mogalapalli
2026-01-31 16:28   ` Jonathan Cameron
2026-01-31 17:32     ` Harshit Mogalapalli
2026-01-30 21:43 ` [PATCH next 2/4] iio: sca3000: switch IRQ handling to devm helpers Harshit Mogalapalli
2026-01-31 16:30   ` Jonathan Cameron
2026-01-31 17:34     ` Harshit Mogalapalli
2026-01-31 19:21   ` David Lechner
2026-01-31 19:28     ` Harshit Mogalapalli
2026-01-30 21:43 ` [PATCH next 3/4] iio: sca3000: manage device registration with devm helper Harshit Mogalapalli
2026-01-31 16:32   ` Jonathan Cameron [this message]
2026-01-30 21:43 ` [PATCH next 4/4] iio: sca3000: stop interrupts via devm_add_action_or_reset() Harshit Mogalapalli
2026-01-31 16:39   ` Jonathan Cameron
2026-01-31 17:52     ` Harshit Mogalapalli

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=20260131163218.2a4b93e5@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andrew.ijano@gmail.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=harshit.m.mogalapalli@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.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