Skip to content

Commit

Permalink
phy: spear1310-miphy: Return proper error for spear1310_miphy_xlate
Browse files Browse the repository at this point in the history
The of_xlate callback should return ERR_PTR on error.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
  • Loading branch information
AxelLin authored and kishon committed Apr 3, 2015
1 parent fbea230 commit 247e21c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/phy/phy-spear1310-miphy.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,14 @@ static struct phy *spear1310_miphy_xlate(struct device *dev,

if (args->args_count < 1) {
dev_err(dev, "DT did not pass correct no of args\n");
return NULL;
return ERR_PTR(-ENODEV);
}

priv->mode = args->args[0];

if (priv->mode != SATA && priv->mode != PCIE) {
dev_err(dev, "DT did not pass correct phy mode\n");
return NULL;
return ERR_PTR(-ENODEV);
}

return priv->phy;
Expand Down

0 comments on commit 247e21c

Please sign in to comment.