[PATCH 1/1] dm: simplify uclass_pre_remove_device

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Sat Mar 18 10:55:49 CET 2023


Remove a superfluous logical constraint.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
---
 drivers/core/uclass.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index 1762a0796d..dce5b46fc7 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -789,14 +789,10 @@ int uclass_post_probe_device(struct udevice *dev)
 int uclass_pre_remove_device(struct udevice *dev)
 {
 	struct uclass *uc;
-	int ret;
 
 	uc = dev->uclass;
-	if (uc->uc_drv->pre_remove) {
-		ret = uc->uc_drv->pre_remove(dev);
-		if (ret)
-			return ret;
-	}
+	if (uc->uc_drv->pre_remove)
+		return uc->uc_drv->pre_remove(dev);
 
 	return 0;
 }
-- 
2.39.2



More information about the U-Boot mailing list