Re: [PATCH v3] iio: adc: qcom-spmi-iadc: balance enable_irq_wake() on driver unbind

From: Konrad Dybcio

Date: Mon Jul 06 2026 - 07:27:01 EST


On 7/4/26 1:04 AM, Jonathan Cameron wrote:
> On Fri, 29 May 2026 14:56:48 +0500
> Stepan Ionichev <sozdayvek@xxxxxxxxx> wrote:
>
>> iadc_probe() calls enable_irq_wake() after a successful
>> devm_request_irq(), but the driver has no remove callback or
>> matching disable_irq_wake(), so the wake reference count on the
>> IRQ is leaked on module unload or driver unbind.
>>
>> Check the IRQ request error first, then register a devm action
>> that calls disable_irq_wake() so the wake reference is released
>> in the same scope as the enable. While here, drop the inverted
>> "if (!ret) ... else return ret" in favour of the standard
>> "if (ret) return ret;" pattern.
>>
>> Fixes: ce0694841ea6 ("iio: iadc: Qualcomm SPMI PMIC current ADC driver")
>> Signed-off-by: Stepan Ionichev <sozdayvek@xxxxxxxxx>
>
> +CC Bjorn and Konrad as we don't seem to have a more specific
> maintainer for this driver.
>
> Seems low risk, but nice to run it past them.

The robot pointed out to me that this makes probe fail if the
irqchip isn't wakeup-capable, but it seems like that's never the
case for the one that will be used (i.e. the QC SPMI bus arbiter)

so:

Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>

Konrad