Skip to content

Commit 532888a

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
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 <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ff6d413 commit 532888a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/base/core.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4944,13 +4944,14 @@ define_dev_printk_level(_dev_info, KERN_INFO);
49444944
*
49454945
* return dev_err_probe(dev, err, ...);
49464946
*
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.
49494949
* 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.
49514953
*
49524954
* Returns @err.
4953-
*
49544955
*/
49554956
int dev_err_probe(const struct device *dev, int err, const char *fmt, ...)
49564957
{

0 commit comments

Comments
 (0)