diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-04-30 18:02:49 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-04-30 12:50:15 -0700 |
commit | 09f012e64e4b8126ed6f02d0a85a57c3a0465cf9 (patch) | |
tree | 7b35305fad718b9d42128d2dd5b1978672128d11 /drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | |
parent | 801eb0501824da196c7b1c18c453528457308c5a (diff) | |
download | linux-09f012e64e4b8126ed6f02d0a85a57c3a0465cf9.tar.gz linux-09f012e64e4b8126ed6f02d0a85a57c3a0465cf9.tar.bz2 linux-09f012e64e4b8126ed6f02d0a85a57c3a0465cf9.zip |
stmmac: intel: Fix clock handling on error and remove paths
clk_prepare_enable() might fail, we have to check its returned value.
Besides that we have to call clk_disable_unprepare() on the error and
remove paths. Do above in the dwmac-intel driver.
While at it, remove leftover in stmmac_pci and remove unneeded condition
for NULL-aware clk_unregister_fixed_rate() call.
Fixes: 58da0cfa6cf1 ("net: stmmac: create dwmac-intel.c to contain all Intel platform")
Cc: Voon Weifeng <weifeng.voon@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c index 3fb21f7ac9fb..272cb47af9f2 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c @@ -217,15 +217,10 @@ static int stmmac_pci_probe(struct pci_dev *pdev, */ static void stmmac_pci_remove(struct pci_dev *pdev) { - struct net_device *ndev = dev_get_drvdata(&pdev->dev); - struct stmmac_priv *priv = netdev_priv(ndev); int i; stmmac_dvr_remove(&pdev->dev); - if (priv->plat->stmmac_clk) - clk_unregister_fixed_rate(priv->plat->stmmac_clk); - for (i = 0; i < PCI_STD_NUM_BARS; i++) { if (pci_resource_len(pdev, i) == 0) continue; |