diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2023-01-24 19:37:24 +0100 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2023-02-03 10:52:49 +0530 |
commit | 9da87c6ef770f5a407952ea2baa0680e7df5ebd9 (patch) | |
tree | 6b58c819d7bc81804deff1ecdda91fd972f65e52 | |
parent | a6ebcae7de16f3af3c328e8fba7c77aac8a910e9 (diff) |
net: lan966x: 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: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Link: https://lore.kernel.org/r/993b0f4ac5b84b2b72223011614d2e821f9e7302.1674584626.git.geert+renesas@glider.be
Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r-- | drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c index cadde20505ba..d64a525cdc9e 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c @@ -1147,9 +1147,8 @@ static int lan966x_probe(struct platform_device *pdev) lan966x->ports[p]->config.portmode = phy_mode; lan966x->ports[p]->fwnode = fwnode_handle_get(portnp); - serdes = devm_of_phy_get(lan966x->dev, to_of_node(portnp), NULL); - if (PTR_ERR(serdes) == -ENODEV) - serdes = NULL; + serdes = devm_of_phy_optional_get(lan966x->dev, + to_of_node(portnp), NULL); if (IS_ERR(serdes)) { err = PTR_ERR(serdes); goto cleanup_ports; |