mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-21 01:51:18 +00:00
driver core: Print device when resources present in really_probe()
[ Upstream commit 7c35e699c8
]
If a device already has devres items attached before probing, a warning
backtrace is printed. However, this backtrace does not reveal the
offending device, leaving the user uninformed. Furthermore, using
WARN_ON() causes systems with panic-on-warn to reboot.
Fix this by replacing the WARN_ON() by a dev_crit() message.
Abort probing the device, to prevent doing more damage to the device's
resources.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20191206132219.28908-1-geert+renesas@glider.be
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3f6af05d1d
commit
a8b37e3241
1 changed files with 4 additions and 1 deletions
|
@ -516,7 +516,10 @@ static int really_probe(struct device *dev, struct device_driver *drv)
|
||||||
atomic_inc(&probe_count);
|
atomic_inc(&probe_count);
|
||||||
pr_debug("bus: '%s': %s: probing driver %s with device %s\n",
|
pr_debug("bus: '%s': %s: probing driver %s with device %s\n",
|
||||||
drv->bus->name, __func__, drv->name, dev_name(dev));
|
drv->bus->name, __func__, drv->name, dev_name(dev));
|
||||||
WARN_ON(!list_empty(&dev->devres_head));
|
if (!list_empty(&dev->devres_head)) {
|
||||||
|
dev_crit(dev, "Resources present before probing\n");
|
||||||
|
return -EBUSY;
|
||||||
|
}
|
||||||
|
|
||||||
re_probe:
|
re_probe:
|
||||||
dev->driver = drv;
|
dev->driver = drv;
|
||||||
|
|
Loading…
Reference in a new issue