Re: [PATCH 2/6] net: ibm: emac: manage emac_irq with devm
From: Andrew Lunn
Date: Mon Sep 02 2024 - 16:07:32 EST
On Mon, Sep 02, 2024 at 11:15:11AM -0700, Rosen Penev wrote:
> It's the last to go in remove. Safe to let devm handle it.
>
> Also move request_irq to probe for clarity. It's removed in _remove not
> close.
>
> Use dev_err instead of printk. Handles names automatically.
>
> + /* Setup error IRQ handler */
> + err = devm_request_irq(&ofdev->dev, dev->emac_irq, emac_irq, 0, "EMAC", dev);
> + if (err) {
> + dev_err(&ofdev->dev, "failed to request IRQ %d", dev->emac_irq);
> + goto err_gone;
> + }
Is this an internal interrupt, or a GPIO? It could be it is done in
open because there is a danger the GPIO controller has not probed
yet. So here you might get an EPROBE_DEFFER, where as the much older
kernel this was written for might not of done, if just gave an error
had gave up. So dev_err_probe() might be better.
Andrew