Commit b3a8df9f authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Jakub Kicinski

net: ethernet: ti: am65-cpsw: Convert to devm_of_phy_optional_get()

Use the new devm_of_phy_optional_get() helper instead of open-coding the
same operation.
Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarSiddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/01605ea233ff7fc09bb0ea34fc8126af73db83f9.1678280599.git.geert+renesas@glider.beSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 76b9bf96
...@@ -1470,11 +1470,9 @@ static int am65_cpsw_init_serdes_phy(struct device *dev, struct device_node *por ...@@ -1470,11 +1470,9 @@ static int am65_cpsw_init_serdes_phy(struct device *dev, struct device_node *por
struct phy *phy; struct phy *phy;
int ret; int ret;
phy = devm_of_phy_get(dev, port_np, name); phy = devm_of_phy_optional_get(dev, port_np, name);
if (PTR_ERR(phy) == -ENODEV) if (IS_ERR_OR_NULL(phy))
return 0; return PTR_ERR_OR_ZERO(phy);
if (IS_ERR(phy))
return PTR_ERR(phy);
/* Serdes PHY exists. Store it. */ /* Serdes PHY exists. Store it. */
port->slave.serdes_phy = phy; port->slave.serdes_phy = phy;
......
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