Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

driver core: Better advertise dev_err_probe()

Describing the usage of dev_err_probe() as being (only?) "deemed
acceptable" has a bad connotation. In fact dev_err_probe() fulfills
three tasks:

- handling of EPROBE_DEFER (even more than degrading to dev_dbg())
- symbolic output of the error code
- return err for compact error code paths

Advertise these better and claim the usage to be "fine" to get rid of
the bad connotation.

Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231215174540.2438601-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Uwe Kleine-König and committed by
Greg Kroah-Hartman
532888a5 ff6d413b

+5 -4
+5 -4
drivers/base/core.c
··· 4944 4944 * 4945 4945 * return dev_err_probe(dev, err, ...); 4946 4946 * 4947 - * Note that it is deemed acceptable to use this function for error 4948 - * prints during probe even if the @err is known to never be -EPROBE_DEFER. 4947 + * Using this helper in your probe function is totally fine even if @err is 4948 + * known to never be -EPROBE_DEFER. 4949 4949 * The benefit compared to a normal dev_err() is the standardized format 4950 - * of the error code and the fact that the error code is returned. 4950 + * of the error code, it being emitted symbolically (i.e. you get "EAGAIN" 4951 + * instead of "-35") and the fact that the error code is returned which allows 4952 + * more compact error paths. 4951 4953 * 4952 4954 * Returns @err. 4953 - * 4954 4955 */ 4955 4956 int dev_err_probe(const struct device *dev, int err, const char *fmt, ...) 4956 4957 {