diff mbox series

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

Message ID 1519436524-24583-1-git-send-email-festevam@gmail.com
State New
Headers show
Series ARM: imx: pm-imx6: Return the error directly | expand

Commit Message

Fabio Estevam Feb. 24, 2018, 1:42 a.m. UTC
From: Fabio Estevam <fabio.estevam@nxp.com>

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

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 arch/arm/mach-imx/pm-imx6.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Shawn Guo Feb. 28, 2018, 3:04 a.m. UTC | #1
On Fri, Feb 23, 2018 at 10:42:04PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> Simplify the error path by returning the error code directly rather
> than jumping to a label.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>

Applied, thanks.
diff mbox series

Patch

diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c
index ecdf071..017539d 100644
--- a/arch/arm/mach-imx/pm-imx6.c
+++ b/arch/arm/mach-imx/pm-imx6.c
@@ -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;
 }