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

From: Raju Lakkaraju
Date: Thu Sep 12 2024 - 02:50:48 EST


Hi Maxime,

Thank you for review the patches.

The 09/11/2024 19:24, Maxime Chevallier wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> 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 :)

Ok. I will remove

But i was little bit confusion here.

In xpcs_create_mdiodev( ) function, inside the mdio_device_create( ) function
allocate memory for mdio_device

Then, in xpcs_create( ) function to create data by calling xpcs_create_data( )
function, create dw_xpcs memory.

It's reason, for safe side, I updte xpcs destroy

>
> Best regards,
>
> Maxime

--
Thanks,
Raju