diff mbox series

[1/3] net: davicom: Fix regulator not turned off on failed probe

Message ID 20210307131749.14960-1-paul@crapouillou.net (mailing list archive)
State Accepted
Commit ac88c531a5b38877eba2365a3f28f0c8b513dc33
Delegated to: Netdev Maintainers
Headers show
Series [1/3] net: davicom: Fix regulator not turned off on failed probe | expand

Checks

Context Check Description
netdev/cover_letter warning Series does not have a cover letter
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers fail 2 blamed authors not CCed: Zubair.Kakakhel@imgtec.com paulburton@kernel.org; 4 maintainers not CCed: Zubair.Kakakhel@imgtec.com paulburton@kernel.org gustavoars@kernel.org andrew@lunn.ch
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 30 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Paul Cercueil March 7, 2021, 1:17 p.m. UTC
When the probe fails or requests to be defered, we must disable the
regulator that was previously enabled.

Fixes: 7994fe55a4a2 ("dm9000: Add regulator and reset support to dm9000")
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/net/ethernet/davicom/dm9000.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org March 8, 2021, 8:10 p.m. UTC | #1
Hello:

This series was applied to netdev/net.git (refs/heads/master):

On Sun,  7 Mar 2021 13:17:47 +0000 you wrote:
> When the probe fails or requests to be defered, we must disable the
> regulator that was previously enabled.
> 
> Fixes: 7994fe55a4a2 ("dm9000: Add regulator and reset support to dm9000")
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---
>  drivers/net/ethernet/davicom/dm9000.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)

Here is the summary with links:
  - [1/3] net: davicom: Fix regulator not turned off on failed probe
    https://git.kernel.org/netdev/net/c/ac88c531a5b3
  - [2/3] net: davicom: Fix regulator not turned off on driver removal
    https://git.kernel.org/netdev/net/c/cf9e60aa69ae
  - [3/3] net: davicom: Use platform_get_irq_optional()
    https://git.kernel.org/netdev/net/c/2e2696223676

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index 3fdc70dab5c1..ae744826bb9e 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -1449,7 +1449,7 @@  dm9000_probe(struct platform_device *pdev)
 		if (ret) {
 			dev_err(dev, "failed to request reset gpio %d: %d\n",
 				reset_gpios, ret);
-			return -ENODEV;
+			goto out_regulator_disable;
 		}
 
 		/* According to manual PWRST# Low Period Min 1ms */
@@ -1461,8 +1461,10 @@  dm9000_probe(struct platform_device *pdev)
 
 	if (!pdata) {
 		pdata = dm9000_parse_dt(&pdev->dev);
-		if (IS_ERR(pdata))
-			return PTR_ERR(pdata);
+		if (IS_ERR(pdata)) {
+			ret = PTR_ERR(pdata);
+			goto out_regulator_disable;
+		}
 	}
 
 	/* Init network device */
@@ -1703,6 +1705,10 @@  dm9000_probe(struct platform_device *pdev)
 	dm9000_release_board(pdev, db);
 	free_netdev(ndev);
 
+out_regulator_disable:
+	if (!IS_ERR(power))
+		regulator_disable(power);
+
 	return ret;
 }