Skip to content

Commit

Permalink
phy: spear1340-miphy: Return proper error for spear1340_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 <axel.lin@ingics.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
  • Loading branch information
Axel Lin authored and Kishon Vijay Abraham I committed Apr 3, 2015
1 parent 247e21c commit 407ed83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/phy/phy-spear1340-miphy.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,14 @@ static struct phy *spear1340_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 407ed83

Please sign in to comment.