提交 108a6537 编写于 作者: G Grygorii Strashko 提交者: David S. Miller

drivers: net: cpsw: check return code from pm runtime calls

Add missed check of return code from PM runtime get() calls.
Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1f95ba00
...@@ -1252,7 +1252,11 @@ static int cpsw_ndo_open(struct net_device *ndev) ...@@ -1252,7 +1252,11 @@ static int cpsw_ndo_open(struct net_device *ndev)
int i, ret; int i, ret;
u32 reg; u32 reg;
pm_runtime_get_sync(&priv->pdev->dev); ret = pm_runtime_get_sync(&priv->pdev->dev);
if (ret < 0) {
pm_runtime_put_noidle(&priv->pdev->dev);
return ret;
}
if (!cpsw_common_res_usage_state(priv)) if (!cpsw_common_res_usage_state(priv))
cpsw_intr_disable(priv); cpsw_intr_disable(priv);
...@@ -2312,7 +2316,11 @@ static int cpsw_probe(struct platform_device *pdev) ...@@ -2312,7 +2316,11 @@ static int cpsw_probe(struct platform_device *pdev)
/* Need to enable clocks with runtime PM api to access module /* Need to enable clocks with runtime PM api to access module
* registers * registers
*/ */
pm_runtime_get_sync(&pdev->dev); ret = pm_runtime_get_sync(&pdev->dev);
if (ret < 0) {
pm_runtime_put_noidle(&pdev->dev);
goto clean_runtime_disable_ret;
}
priv->version = readl(&priv->regs->id_ver); priv->version = readl(&priv->regs->id_ver);
pm_runtime_put_sync(&pdev->dev); pm_runtime_put_sync(&pdev->dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册