summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/stmicro/stmmac/stmmac.h
diff options
context:
space:
mode:
authorGiuseppe CAVALLARO <peppe.cavallaro@st.com>2012-04-18 19:48:22 +0000
committerDavid S. Miller <davem@davemloft.net>2012-04-19 20:09:06 -0400
commit31ea38eefea0a8b40d1ef65842ed66847b13979f (patch)
treece41d4f60486e6ce752888e73540386f9488a073 /drivers/net/ethernet/stmicro/stmmac/stmmac.h
parent0f1f88a875bd6c6725501183fabeb99a70c35757 (diff)
stmmac: do not fail when probe and there is no csr clk defined
On some platforms, for example where we are doing the bring-up, the csr clock is not passed from the framework and the Ethernet device driver is failing when it can work w/o any issues and using the default values. So this patch just warnings the case of the csr clock cannot be acquired but w/o failing the probe step. I have just tested it on ST STiH415 SoC (ARM). Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac.h')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index 9f2435c53f57..db2de9a49952 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -107,7 +107,7 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
#ifdef CONFIG_HAVE_CLK
static inline int stmmac_clk_enable(struct stmmac_priv *priv)
{
- if (priv->stmmac_clk)
+ if (!IS_ERR(priv->stmmac_clk))
return clk_enable(priv->stmmac_clk);
return 0;
@@ -115,17 +115,18 @@ static inline int stmmac_clk_enable(struct stmmac_priv *priv)
static inline void stmmac_clk_disable(struct stmmac_priv *priv)
{
- if (priv->stmmac_clk)
- clk_disable(priv->stmmac_clk);
+ if (IS_ERR(priv->stmmac_clk))
+ return;
+
+ clk_disable(priv->stmmac_clk);
}
static inline int stmmac_clk_get(struct stmmac_priv *priv)
{
priv->stmmac_clk = clk_get(priv->device, NULL);
- if (IS_ERR(priv->stmmac_clk)) {
- pr_err("%s: ERROR clk_get failed\n", __func__);
+ if (IS_ERR(priv->stmmac_clk))
return PTR_ERR(priv->stmmac_clk);
- }
+
return 0;
}
#else