diff options
author | Kangjie Lu <kjlu@umn.edu> | 2018-12-26 03:57:14 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-12-28 01:20:44 +0100 |
commit | f86a3b83833e7cfe558ca4d70b64ebc48903efec (patch) | |
tree | 35ac59cc154f9fe2b3ccb3cb47872e3681d0b484 /drivers/net | |
parent | net: (cpts) fix a missing check of clk_prepare (diff) | |
download | linux-f86a3b83833e7cfe558ca4d70b64ebc48903efec.tar.xz linux-f86a3b83833e7cfe558ca4d70b64ebc48903efec.zip |
net: stmicro: fix a missing check of clk_prepare
clk_prepare() could fail, so let's check its status, and if it fails,
return its error code upstream.
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c index d07520fb969e..62ccbd47c1db 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c @@ -59,7 +59,9 @@ static int sun7i_gmac_init(struct platform_device *pdev, void *priv) gmac->clk_enabled = 1; } else { 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; |