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 <sjg@chromium.org>
This commit is contained in:
Simon Glass 2023-08-24 13:55:35 -06:00 committed by Tom Rini
parent fbd644e702
commit c837a1423c

View File

@ -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",