Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
Cc: linux-iio@vger.kernel.org, dlechner@baylibre.com,
	nuno.sa@analog.com, andy@kernel.org, nicolas.ferre@microchip.com,
	alexandre.belloni@bootlin.com, claudiu.beznea@tuxon.dev,
	giorgitchankvetadze1997@gmail.com, amin.gattout@gmail.com,
	antoniu.miclaus@analog.com, gregkh@linuxfoundation.org,
	mripard@kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 3/3] iio: adc: at91_adc: convert to device-managed resources
Date: Sun, 22 Nov 2026 00:23:37 +0000	[thread overview]
Message-ID: <20261122002337.5fcb85ce@jic23-hlaptop> (raw)
In-Reply-To: <20261117140510.391907-4-abdelnasserhussein11@gmail.com>

On Tue, 17 Nov 2026 16:05:10 +0200
Abdelnasser Hussein <abdelnasserhussein11@gmail.com> wrote:

> Convert the driver to device-managed APIs so that all resources are
> freed automatically on probe failure and on driver detach:
> 
>   - allocate and register the IIO triggers directly in at91_adc_probe()
>     with devm_iio_trigger_alloc() and devm_iio_trigger_register(),
>     dropping at91_adc_allocate_trigger(), at91_adc_trigger_init() and
>     at91_adc_trigger_remove() along with their manual rollback paths
>   - set up the triggered buffer with devm_iio_triggered_buffer_setup()
>     directly in at91_adc_probe(), dropping at91_adc_buffer_init() and
>     at91_adc_buffer_remove()
>   - allocate the touchscreen input device with
>     devm_input_allocate_device(), dropping at91_ts_unregister() and the
>     manual input_free_device() error path in at91_ts_register()
>   - register the IIO device with devm_iio_device_register()
> 
> at91_adc_probe() no longer needs any error unwinding labels and
> at91_adc_remove() is removed together with the platform driver's
> .remove callback.
> 
> Suggested-by: Jonathan Cameron <jic23@kernel.org>
> Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>

Looks good in general. Even better with the stuff Andy spotted that
would be nice to do whilst you are here!

Thanks,

Jonathan


      parent reply	other threads:[~2026-11-22  0:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 14:05 [PATCH v4 0/3] iio: adc: at91_adc: fix trigger NULL deref and convert to devm_* Abdelnasser Hussein
2026-11-17 14:05 ` [PATCH v4 1/3] iio: adc: at91_adc: fix NULL pointer dereference on trigger remove Abdelnasser Hussein
2026-11-17 16:44   ` Andy Shevchenko
2026-11-17 16:45     ` Andy Shevchenko
2026-11-22  0:21       ` Jonathan Cameron
2026-11-17 14:05 ` [PATCH v4 2/3] iio: adc: at91_adc: use local struct device pointer in probe Abdelnasser Hussein
2026-11-17 16:50   ` Andy Shevchenko
2026-11-17 14:05 ` [PATCH v4 3/3] iio: adc: at91_adc: convert to device-managed resources Abdelnasser Hussein
2026-11-17 16:57   ` Andy Shevchenko
2026-11-22  0:23   ` 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=20261122002337.5fcb85ce@jic23-hlaptop \
    --to=jic23@kernel.org \
    --cc=abdelnasserhussein11@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=amin.gattout@gmail.com \
    --cc=andy@kernel.org \
    --cc=antoniu.miclaus@analog.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=dlechner@baylibre.com \
    --cc=giorgitchankvetadze1997@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mripard@kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --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