diff options
author | Kweh, Hock Leong <hock.leong.kweh@intel.com> | 2014-09-26 09:42:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-29 16:36:58 -0400 |
commit | c5bb86c3848174aad59ea6cf5748e210fbb8f744 (patch) | |
tree | fab586db24a1c1c5761b72ea716c15c782d2a37d /drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |
parent | 17c9c8232663a47f074b7452b9b034efda868ca7 (diff) |
net: stmmac: fix stmmac_pci_probe failed when CONFIG_HAVE_CLK is selected
When the CONFIG_HAVE_CLK is selected for the system, the stmmac_pci_probe
will fail with dmesg:
[ 2.167225] stmmaceth 0000:00:14.6: enabling device (0000 -> 0002)
[ 2.178267] stmmaceth 0000:00:14.6: enabling bus mastering
[ 2.178436] stmmaceth 0000:00:14.6: irq 24 for MSI/MSI-X
[ 2.178703] stmmaceth 0000:00:14.6: stmmac_dvr_probe: warning: cannot
get CSR clock
[ 2.186503] stmmac_pci_probe: main driver probe failed
[ 2.194003] stmmaceth 0000:00:14.6: disabling bus mastering
[ 2.196473] stmmaceth: probe of 0000:00:14.6 failed with error -2
This patch fix the issue by breaking the dependency to devm_clk_get()
as the CSR clock can be obtained at priv->plat->clk_csr from pci driver.
Reported-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Signed-off-by: Kweh, Hock Leong <hock.leong.kweh@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac_main.c')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 6e6ee226de04..b0c1521e08a3 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
@@ -2786,8 +2786,15 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device, | |||
2786 | if (IS_ERR(priv->stmmac_clk)) { | 2786 | if (IS_ERR(priv->stmmac_clk)) { |
2787 | dev_warn(priv->device, "%s: warning: cannot get CSR clock\n", | 2787 | dev_warn(priv->device, "%s: warning: cannot get CSR clock\n", |
2788 | __func__); | 2788 | __func__); |
2789 | ret = PTR_ERR(priv->stmmac_clk); | 2789 | /* If failed to obtain stmmac_clk and specific clk_csr value |
2790 | goto error_clk_get; | 2790 | * is NOT passed from the platform, probe fail. |
2791 | */ | ||
2792 | if (!priv->plat->clk_csr) { | ||
2793 | ret = PTR_ERR(priv->stmmac_clk); | ||
2794 | goto error_clk_get; | ||
2795 | } else { | ||
2796 | priv->stmmac_clk = NULL; | ||
2797 | } | ||
2791 | } | 2798 | } |
2792 | clk_prepare_enable(priv->stmmac_clk); | 2799 | clk_prepare_enable(priv->stmmac_clk); |
2793 | 2800 | ||