Re: [PATCH v3 1/7] iio: light: opt3001: move device registration to end of probe()

From: Joshua Crofts

Date: Thu May 21 2026 - 07:04:03 EST


On Thu, 21 May 2026 at 11:55, Joshua Crofts via B4 Relay
<devnull+joshua.crofts1.gmail.com@xxxxxxxxxx> wrote:
> /* Make use of INT pin only if valid IRQ no. is given */
> if (irq > 0) {
> ret = request_threaded_irq(irq, NULL, opt3001_irq,
> @@ -894,7 +888,7 @@ static int opt3001_probe(struct i2c_client *client)
> dev_dbg(opt->dev, "enabling interrupt-less operation\n");
> }
>
> - return 0;
> + return iio_device_register(iio);
> }

As Sashiko correctly pointed out, I'm not freeing the irq on failure,
therefore potentially leaking resources. This will definitely be fixed
in v4.

https://sashiko.dev/#/patchset/20260521-opt3001-cleanup-v3-0-820169dec8c3%40gmail.com

--
Kind regards

CJD