Re: [PATCH] nfc: nxp-nci: Add remove on IRQ error

From: Ian Ray

Date: Tue Jul 07 2026 - 13:19:57 EST


On Tue, Jul 07, 2026 at 04:23:27PM +0200, Greg Kroah-Hartman wrote:
> From: Griffin Kroah-Hartman <griffin@xxxxxxxxx>
>
> Add a call to nxp_nci_remove() in nxp_nci_i2c_probe() when the
> request_threaded_irq() fails.
> Previously, IRQ resources were not being freed upon error.
>
> Assisted-by: gkh_clanker_2000
> Cc: David Heidelberg <david@xxxxxxx>
> Cc: Carl Lee <carl.lee@xxxxxxx>
> Cc: Jakub Kicinski <kuba@xxxxxxxxxx>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxxxxx>
> Cc: Ian Ray <ian.ray@xxxxxxxxxxxxxxxx>
> Cc: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@xxxxxxxxxxxx>
> Signed-off-by: Griffin Kroah-Hartman <griffin@xxxxxxxxx>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

Nice improvement!

Reviewed-by: Ian Ray <ian.ray@xxxxxxxxxxxxxxxx>

> ---
> drivers/nfc/nxp-nci/i2c.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
> index faebc89a7ef5..564f38735510 100644
> --- a/drivers/nfc/nxp-nci/i2c.c
> +++ b/drivers/nfc/nxp-nci/i2c.c
> @@ -334,8 +334,10 @@ static int nxp_nci_i2c_probe(struct i2c_client *client)
> nxp_nci_i2c_irq_thread_fn,
> irqflags | IRQF_ONESHOT,
> NXP_NCI_I2C_DRIVER_NAME, phy);
> - if (r < 0)
> + if (r < 0) {
> nfc_err(&client->dev, "Unable to register IRQ handler\n");
> + nxp_nci_remove(phy->ndev);
> + }
>
> return r;
> }
> --
> 2.55.0
>