Re: [PATCH v4 1/8] iio: light: opt3001: move device registration to end of probe()
From: Joshua Crofts
Date: Mon May 25 2026 - 05:11:02 EST
On Mon, 25 May 2026 at 10:20, Joshua Crofts via B4 Relay
<devnull+joshua.crofts1.gmail.com@xxxxxxxxxx> wrote:
>
> From: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
>
> Move IIO device registration to the end of the probe() function to
> follow standard driver teardown/setup ordering and improve driver
> logic. Additionally, switch devm_iio_device_register() to its
> unmanaged counterpart as current driver implementation mixes managed
> and unmanaged resources, causing potential resource leaks.
>
> Also, add iio_device_unregister() to remove() function to correctly
> handle teardown.
>
> Suggested-by: Jonathan Cameron <jic23@xxxxxxxxxx>
> Signed-off-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
> ---
Unrelated to this patch, Sashiko did find an issue where get_processed()
is returning an error code directly instead of jumping to the err label.
https://sashiko.dev/#/message/20260525-opt3001-cleanup-v4-1-65b36a174f78%40gmail.com
--
Kind regards
CJD