[PATCH 03/11] can: c_can: register_c_can_dev(): convert to goto style error handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>

Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
(cherry picked from commit 73cc2819a38fa0f899298b93816bef81fc6ab6f9)
Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
Signed-off-by: Kurt Van Dijck <dev.kurt@xxxxxxxxxxxxxxxxxxxxxx>
---
 drivers/net/can/c_can/c_can.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index 8e9f562..c436868 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -1351,9 +1351,14 @@ int register_c_can_dev(struct net_device *dev)
 
 	err = register_candev(dev);
 	if (err)
-		c_can_pm_runtime_disable(priv);
-	else
-		devm_can_led_init(dev);
+		goto register_exit_runtime_disable;
+
+	devm_can_led_init(dev);
+
+	return 0;
+
+ register_exit_runtime_disable:
+	c_can_pm_runtime_disable(priv);
 
 	return err;
 }
-- 
1.8.5.rc3




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux