Skip to content

Commit

Permalink
drivers: net: cpsw: check return code from pm runtime calls
Browse files Browse the repository at this point in the history
Add missed check of return code from PM runtime get() calls.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Grygorii Strashko authored and David S. Miller committed Jun 28, 2016
1 parent 1f95ba0 commit 108a653
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions drivers/net/ethernet/ti/cpsw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,11 @@ static int cpsw_ndo_open(struct net_device *ndev)
int i, ret;
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))
cpsw_intr_disable(priv);
Expand Down Expand Up @@ -2312,7 +2316,11 @@ static int cpsw_probe(struct platform_device *pdev)
/* Need to enable clocks with runtime PM api to access module
* 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);
pm_runtime_put_sync(&pdev->dev);

Expand Down

0 comments on commit 108a653

Please sign in to comment.