Re: [PATCH v4 1/3] pps: clients: gpio: propagate probe error codes

From
Rodolfo Giometti <giometti@enneenne.com>
Date
2026-09-22 08:22:49
Also in
linux-gpio, lkml
Reply to
Farber, Eliav, 2026-09-22
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@enneenne.com
Linux Device Driver                          giometti@linux.it
Embedded Systems                     phone:  +39 349 2432127
UNIX programming
Thread (69 messages) 69 messages, 6 authors, last reply 16d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help