Re: [PATCH v4 1/3] pps: clients: gpio: propagate probe error codes
From: Rodolfo Giometti
Date: Tue Sep 22 2026 - 04:26:59 EST
On Tue, Sep 22, 2026 at 08:08:09AM +0000, Farber, Eliav wrote:
Agreed on silencing the deferral spam. I avoided return dev_err_probe()
because patch 3 turns both returns into goto err_release_pins, and
dev_err_probe()'s idiom is to return the error, not goto.
You don't have to return it. Calling it just for the message and then
jumping is fine, and ret already carries the code the label needs:
if (ret < 0) {
dev_err_probe(dev, ret, "failed to map GPIO to IRQ\n");
goto err_release_pins;
}
But please don't open-code it: on the -EPROBE_DEFER branch it also
calls device_set_deferred_probe_reason(), so the hand-written version
silently drops the reason from /sys/kernel/debug/devices_deferred.
One more thing: dev_err_probe() already prints the code as %pe, so drop
the ": %d" from both messages -- data->irq of course stays in the second
one.
In this patch it can still be a plain
return dev_err_probe(dev, ret, "failed to map GPIO to IRQ\n");
and patch 3 turns it into the goto form above. Same for the request_irq
one.
Ciao,
Rodolfo
--
GNU/Linux Solutions e-mail: giometti@xxxxxxxxxxxx
Linux Device Driver giometti@xxxxxxxx
Embedded Systems phone: +39 349 2432127
UNIX programming