[PATCH 3/7] net: lan966x: Convert to devm_of_phy_optional_get()

Steen Hegelund steen.hegelund at microchip.com
Fri Jan 20 00:46:05 PST 2023


Hi Geert,

This looks good to me.

BR
Steen

Reviewed-by: Steen Hegelund <Steen.Hegelund at microchip.com>

On Wed, 2023-01-18 at 11:15 +0100, Geert Uytterhoeven wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
> 
> Use the new devm_of_phy_optional_get() helper instead of open-coding the
> same operation.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas at glider.be>
> ---
>  drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 5 ++---
>  1 file 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 cadde20505ba0689..d64a525cdc9ea18b 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;
> --
> 2.34.1
> 



More information about the linux-phy mailing list