[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <d6358648c5b9420d8202bb9c23ac1824@amazon.com>
Date: Tue, 27 May 2025 09:11:48 +0000
From: "Farber, Eliav" <farbere@...zon.com>
To: Rodolfo Giometti <giometti@...eenne.com>
CC: "Chocron, Jonathan" <jonnyc@...zon.com>, "gregkh@...uxfoundation.org"
<gregkh@...uxfoundation.org>, "mschmidt@...hat.com" <mschmidt@...hat.com>,
"calvin@...nvd.org" <calvin@...nvd.org>, "tglx@...utronix.de"
<tglx@...utronix.de>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] pps: clients: gpio: fix interrupt handling order in
remove path
>> @@ -228,6 +228,7 @@ static void pps_gpio_remove(struct platform_device *pdev)
>> {
>> struct pps_gpio_device_data *data = platform_get_drvdata(pdev);
>>
>> + free_irq(data->irq, data);
>
> Why not just use devm_free_irq()?
As far as I understand, the main purpose of devm_*() is to provide
hands-off resource management. devm_request_irq() is intended to
eliminate the need for explicit cleanup in the remove() function by
automatically freeing the IRQ after remove() returns.
In my opinion, calling devm_free_irq() undermines the benefit of using
devm_request_irq() in the first place. If I need to explicitly free the
IRQ during remove(), then I’m no longer relying on devm’s automatic
cleanup - I’m effectively reverting to manual resource management while
still using devm-style registration, which I find unnecessary.
That said, if you still favor devm_free_irq(), I’ll revise the patch
accordingly.
Regards, Eliav
Powered by blists - more mailing lists