Skip to contentSkip to conversation

ARM: imx: pm-imx6: Return the error directly

PATCH New Fabio Estevam 2 participants 2 messages Feb 24, 2018 – Feb 28, 2018

Subsystems (3)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 ARM: imx: pm-imx6: Return the error directly

From: Fabio Estevam <[email protected]>

Simplify the error path by returning the error code directly rather than jumping to a label.

---
 arch/arm/mach-imx/pm-imx6.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
arch/arm/mach-imx/pm-imx6.c +2 -5
index ecdf071..017539d 100644
@@ -428,10 +428,8 @@ static int __init imx6_pm_get_base(struct imx6_pm_base *base,
 	int ret = 0;
 
 	node = of_find_compatible_node(NULL, NULL, compat);
-	if (!node) {
-		ret = -ENODEV;
-		goto out;
-	}
+	if (!node)
+		return -ENODEV;
 
 	ret = of_address_to_resource(node, 0, &res);
 	if (ret)
@@ -444,7 +442,6 @@ static int __init imx6_pm_get_base(struct imx6_pm_base *base,
 
 put_node:
 	of_node_put(node);
-out:
 	return ret;
 }
 
Signature · 1 line
2.7.4