Commit 5189b1d8 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by David S. Miller

of_mdio: use PTR_ERR_OR_ZERO()

PTR_ERR_OR_ZERO() is open coded in of_phy_register_fixed_link(), so just
call it directly...
Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: default avatarVladimir Zapolskiy <vz@mleia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ac044b90
...@@ -412,7 +412,7 @@ int of_phy_register_fixed_link(struct device_node *np) ...@@ -412,7 +412,7 @@ int of_phy_register_fixed_link(struct device_node *np)
if (strcmp(managed, "in-band-status") == 0) { if (strcmp(managed, "in-band-status") == 0) {
/* status is zeroed, namely its .link member */ /* status is zeroed, namely its .link member */
phy = fixed_phy_register(PHY_POLL, &status, -1, np); phy = fixed_phy_register(PHY_POLL, &status, -1, np);
return IS_ERR(phy) ? PTR_ERR(phy) : 0; return PTR_ERR_OR_ZERO(phy);
} }
} }
...@@ -434,7 +434,7 @@ int of_phy_register_fixed_link(struct device_node *np) ...@@ -434,7 +434,7 @@ int of_phy_register_fixed_link(struct device_node *np)
return -EPROBE_DEFER; return -EPROBE_DEFER;
phy = fixed_phy_register(PHY_POLL, &status, link_gpio, np); 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 */ /* Old binding */
...@@ -446,7 +446,7 @@ int of_phy_register_fixed_link(struct device_node *np) ...@@ -446,7 +446,7 @@ int of_phy_register_fixed_link(struct device_node *np)
status.pause = be32_to_cpu(fixed_link_prop[3]); status.pause = be32_to_cpu(fixed_link_prop[3]);
status.asym_pause = be32_to_cpu(fixed_link_prop[4]); status.asym_pause = be32_to_cpu(fixed_link_prop[4]);
phy = fixed_phy_register(PHY_POLL, &status, -1, np); 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; return -ENODEV;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment