Skip to content

Commit

Permalink
of_mdio: use PTR_ERR_OR_ZERO()
Browse files Browse the repository at this point in the history
PTR_ERR_OR_ZERO() is open coded in of_phy_register_fixed_link(), so just
call it directly...

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sergei Shtylyov authored and David S. Miller committed Mar 14, 2016
1 parent ac044b9 commit 5189b1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/of/of_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ int of_phy_register_fixed_link(struct device_node *np)
if (strcmp(managed, "in-band-status") == 0) {
/* status is zeroed, namely its .link member */
phy = fixed_phy_register(PHY_POLL, &status, -1, np);
return IS_ERR(phy) ? PTR_ERR(phy) : 0;
return PTR_ERR_OR_ZERO(phy);
}
}

Expand All @@ -434,7 +434,7 @@ int of_phy_register_fixed_link(struct device_node *np)
return -EPROBE_DEFER;

phy = fixed_phy_register(PHY_POLL, &status, link_gpio, np);
return IS_ERR(phy) ? PTR_ERR(phy) : 0;
return PTR_ERR_OR_ZERO(phy);
}

/* Old binding */
Expand All @@ -446,7 +446,7 @@ int of_phy_register_fixed_link(struct device_node *np)
status.pause = be32_to_cpu(fixed_link_prop[3]);
status.asym_pause = be32_to_cpu(fixed_link_prop[4]);
phy = fixed_phy_register(PHY_POLL, &status, -1, np);
return IS_ERR(phy) ? PTR_ERR(phy) : 0;
return PTR_ERR_OR_ZERO(phy);
}

return -ENODEV;
Expand Down

0 comments on commit 5189b1d

Please sign in to comment.