Re: [v2,net] net: phy: broadcom: Correct BCM5221 PHY model detection failure
From: Russell King (Oracle)
Date: Mon Mar 24 2025 - 12:58:04 EST
On Tue, Mar 18, 2025 at 11:15:09AM +0800, Jim Liu wrote:
> Maybe i can add this modify in patch
>
> #define BRCM_PHY_MODEL(phydev) \
> - ((phydev)->drv->phy_id & (phydev)->drv->phy_id_mask)
> + ((phydev)->phy_id & (phydev)->drv->phy_id_mask)
I would suggest that this becomes merely:
#define BRCM_PHY_MODEL(phydev) ((phydev))->drv->phy_id)
because the constants that are being used to check against this are the
constants used to initialise that member.
Or even get rid of BRCM_PHY_MODEL() altogether, thus the tests become
(e.g.):
/* Unmask events we are interested in and mask interrupts globally. */
- if (phydev->phy_id == PHY_ID_BCM5221)
+ if (phydev->drv->phy_id == PHY_ID_BCM5221)
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!