Skip to content

Commit 32de4b4

Browse files
nfrapradogregkh
authored andcommitted
driver: core: Log probe failure as error and with device metadata
Drivers can return -ENODEV or -ENXIO from their probe to reject a device match, and return -EPROBE_DEFER if probe should be retried. Any other error code is not expected during normal behavior and indicates an issue occurred, so it should be logged at the error level. Also make use of the device variant, dev_err(), so that the device metadata is attached to the log message. Signed-off-by: "Nícolas F. R. A. Prado" <nfraprado@collabora.com> Link: https://lore.kernel.org/r/20240305-device-probe-error-v1-1-a06d8722bf19@collabora.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 135116f commit 32de4b4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/base/dd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,8 +592,8 @@ static int call_driver_probe(struct device *dev, struct device_driver *drv)
592592
break;
593593
default:
594594
/* driver matched but the probe failed */
595-
pr_warn("%s: probe of %s failed with error %d\n",
596-
drv->name, dev_name(dev), ret);
595+
dev_err(dev, "probe with driver %s failed with error %d\n",
596+
drv->name, ret);
597597
break;
598598
}
599599

0 commit comments

Comments
 (0)