]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/net/ethernet/arc/emac_rockchip.c
net: ethernet: arc: fix error handling in emac_rockchip_probe
[mirror_ubuntu-bionic-kernel.git] / drivers / net / ethernet / arc / emac_rockchip.c
index e278e3d96ee010235ec4d21696a996b68cb3ef18..c6163874e4e7e136fb953aff74eab4fff401cb75 100644 (file)
@@ -220,9 +220,11 @@ static int emac_rockchip_probe(struct platform_device *pdev)
 
                /* RMII TX/RX needs always a rate of 25MHz */
                err = clk_set_rate(priv->macclk, 25000000);
-               if (err)
+               if (err) {
                        dev_err(dev,
                                "failed to change mac clock rate (%d)\n", err);
+                       goto out_clk_disable_macclk;
+               }
        }
 
        err = arc_emac_probe(ndev, interface);
@@ -232,7 +234,8 @@ static int emac_rockchip_probe(struct platform_device *pdev)
        }
 
        return 0;
-
+out_clk_disable_macclk:
+       clk_disable_unprepare(priv->macclk);
 out_regulator_disable:
        if (priv->regulator)
                regulator_disable(priv->regulator);