Re: [PATCH net-next V2 4/5] net: lan743x: Implement phylink pcs

From: Maxime Chevallier
Date: Wed Sep 11 2024 - 13:24:45 EST


Hello Raju,

On Wed, 11 Sep 2024 21:40:53 +0530
Raju Lakkaraju <Raju.Lakkaraju@xxxxxxxxxxxxx> wrote:

[...]

> @@ -3820,9 +3869,28 @@ static int lan743x_mdiobus_init(struct lan743x_adapter *adapter)
> ret = mdiobus_register(adapter->mdiobus);
> if (ret < 0)
> goto return_error;
> +
> + if (adapter->is_sfp_support_en) {
> + if (!adapter->phy_interface)
> + lan743x_phy_interface_select(adapter);
> +
> + xpcs = xpcs_create_mdiodev(adapter->mdiobus, 0,
> + adapter->phy_interface);
> + if (IS_ERR(xpcs)) {
> + netdev_err(adapter->netdev, "failed to create xpcs\n");
> + ret = PTR_ERR(xpcs);
> + goto err_destroy_xpcs;
> + }
> + adapter->xpcs = xpcs;
> + }
> +
> return 0;
>
> +err_destroy_xpcs:
> + xpcs_destroy(xpcs);

It looks like here, you're destroying the xpcs only when the xpcs
couln't be created in the first place, so no need to destroy it :)

Best regards,

Maxime