Commit d29d4ccc authored by Kangjie Lu's avatar Kangjie Lu Committed by Greg Kroah-Hartman

net: stmicro: fix a missing check of clk_prepare

[ Upstream commit f86a3b83 ]

clk_prepare() could fail, so let's check its status, and if it fails,
return its error code upstream.
Signed-off-by: default avatarKangjie Lu <kjlu@umn.edu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 7d751914
...@@ -59,7 +59,9 @@ static int sun7i_gmac_init(struct platform_device *pdev, void *priv) ...@@ -59,7 +59,9 @@ static int sun7i_gmac_init(struct platform_device *pdev, void *priv)
gmac->clk_enabled = 1; gmac->clk_enabled = 1;
} else { } else {
clk_set_rate(gmac->tx_clk, SUN7I_GMAC_MII_RATE); clk_set_rate(gmac->tx_clk, SUN7I_GMAC_MII_RATE);
clk_prepare(gmac->tx_clk); ret = clk_prepare(gmac->tx_clk);
if (ret)
return ret;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment