From c837a1423c876669bfd963e1ded518b9e497946d Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 24 Aug 2023 13:55:35 -0600 Subject: dm: core: Correct error handling when event fails Follow the correct path in device_probe() when and event handler fails. This avoids getting into a strange state where the device appears to be activated but is not. Signed-off-by: Simon Glass --- drivers/core/device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/core/device.c') diff --git a/drivers/core/device.c b/drivers/core/device.c index 6e26b64fb81..60f8d6700ad 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -598,9 +598,10 @@ int device_probe(struct udevice *dev) ret = device_notify(dev, EVT_DM_POST_PROBE); if (ret) - return ret; + goto fail_event; return 0; +fail_event: fail_uclass: if (device_remove(dev, DM_REMOVE_NORMAL)) { dm_warn("%s: Device '%s' failed to remove on error path\n", -- cgit v1.2.3 From 1e94b46f73cedcebbff73799203f3266c5b28d90 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 14 Sep 2023 18:21:46 -0600 Subject: common: Drop linux/printk.h from common header This old patch was marked as deferred. Bring it back to life, to continue towards the removal of common.h Move this out of the common header and include it only where needed. Signed-off-by: Simon Glass --- drivers/core/device.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/core/device.c') diff --git a/drivers/core/device.c b/drivers/core/device.c index 60f8d6700ad..bf7f261cbce 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -33,6 +33,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; -- cgit v1.2.3