[U-Boot] [PATCH 4/5] dm: core: Remove the call to device_free()

Bin Meng bmeng.cn at gmail.com
Fri Sep 4 16:53:34 CEST 2015


When something goes wrong during device_probe(), we just need do
device_remove() which calls device_free() internally.

Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
---

 drivers/core/device.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/core/device.c b/drivers/core/device.c
index a6cd936..061a7ef 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -316,19 +316,14 @@ int device_probe_child(struct udevice *dev, void *parent_priv)
 
 	ret = uclass_post_probe_device(dev);
 	if (ret)
-		goto fail_uclass;
+		goto fail;
 
 	return 0;
-fail_uclass:
+fail:
 	if (device_remove(dev)) {
 		dm_warn("%s: Device '%s' failed to remove on error path\n",
 			__func__, dev->name);
 	}
-fail:
-	dev->flags &= ~DM_FLAG_ACTIVATED;
-
-	dev->seq = -1;
-	device_free(dev);
 
 	return ret;
 }
-- 
1.8.2.1



More information about the U-Boot mailing list