Skip to contentSkip to conversation

pinctrl: at91: simplify probe error handling

PATCH New Baruch Siach 4 participants 4 messages Mar 2, 2015 – Mar 9, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: at91: simplify probe error handling

There is no code ender the 'err' label. Just return the error code directly.

---
 drivers/pinctrl/pinctrl-at91.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/pinctrl/pinctrl-at91.c +1 -5
index f4cd0b9b2438..6cfe534ab27e 100644
@@ -1240,8 +1240,7 @@ static int at91_pinctrl_probe(struct platform_device *pdev)
 
 	if (!info->pctl) {
 		dev_err(&pdev->dev, "could not register AT91 pinctrl driver\n");
-		ret = -EINVAL;
-		goto err;
+		return -EINVAL;
 	}
 
 	/* We will handle a range of GPIO pins */
@@ -1252,9 +1251,6 @@ static int at91_pinctrl_probe(struct platform_device *pdev)
 	dev_info(&pdev->dev, "initialized AT91 pinctrl driver\n");
 
 	return 0;
-
-err:
-	return ret;
 }
 
 static int at91_pinctrl_remove(struct platform_device *pdev)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 pinctrl: at91: simplify probe error handling

Quoted 3 lines · Baruch Siach

There is no code ender the 'err' label. Just return the error code directly.

Quoted 36 lines
---
 drivers/pinctrl/pinctrl-at91.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/pinctrl/pinctrl-at91.c +1 -5
index f4cd0b9b2438..6cfe534ab27e 100644
@@ -1240,8 +1240,7 @@ static int at91_pinctrl_probe(struct platform_device *pdev)
 
 	if (!info->pctl) {
 		dev_err(&pdev->dev, "could not register AT91 pinctrl driver\n");
-		ret = -EINVAL;
-		goto err;
+		return -EINVAL;
 	}
 
 	/* We will handle a range of GPIO pins */
@@ -1252,9 +1251,6 @@ static int at91_pinctrl_probe(struct platform_device *pdev)
 	dev_info(&pdev->dev, "initialized AT91 pinctrl driver\n");
 
 	return 0;
-
-err:
-	return ret;
 }
 
 static int at91_pinctrl_remove(struct platform_device *pdev)
Signature · 7 lines
2.1.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 3 lines
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 pinctrl: at91: simplify probe error handling

In reply to Baruch Siach
Quoted 2 lines · Baruch Siach

There is no code ender the 'err' label. Just return the error code directly.

Probably a remainder of pre managed resources time.

Quoted 1 line
Quoted 36 lines
---
 drivers/pinctrl/pinctrl-at91.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/pinctrl/pinctrl-at91.c +1 -5
index f4cd0b9b2438..6cfe534ab27e 100644
@@ -1240,8 +1240,7 @@ static int at91_pinctrl_probe(struct platform_device *pdev)
 
 	if (!info->pctl) {
 		dev_err(&pdev->dev, "could not register AT91 pinctrl driver\n");
-		ret = -EINVAL;
-		goto err;
+		return -EINVAL;
 	}
 
 	/* We will handle a range of GPIO pins */
@@ -1252,9 +1251,6 @@ static int at91_pinctrl_probe(struct platform_device *pdev)
 	dev_info(&pdev->dev, "initialized AT91 pinctrl driver\n");
 
 	return 0;
-
-err:
-	return ret;
 }
 
 static int at91_pinctrl_remove(struct platform_device *pdev)
Signature · 7 lines
2.1.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel