stmmac: intel: Fix clock handling on error and remove paths
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 30 Apr 2020 15:02:49 +0000 (18:02 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Apr 2020 19:50:15 +0000 (12:50 -0700)
commit09f012e64e4b8126ed6f02d0a85a57c3a0465cf9
tree7b35305fad718b9d42128d2dd5b1978672128d11
parent801eb0501824da196c7b1c18c453528457308c5a
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>
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c