Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b8089f0 authored by Paul Cercueil's avatar Paul Cercueil Committed by Greg Kroah-Hartman
Browse files

net: davicom: Fix regulator not turned off on failed probe



commit ac88c531a5b38877eba2365a3f28f0c8b513dc33 upstream.

When the probe fails or requests to be defered, we must disable the
regulator that was previously enabled.

Fixes: 7994fe55 ("dm9000: Add regulator and reset support to dm9000")
Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ec642403
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -1460,7 +1460,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 */
@@ -1472,8 +1472,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 */
@@ -1716,6 +1718,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;
}