[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d440416f-103b-49a1-a077-c6003be9f80f@lunn.ch>
Date: Sun, 24 Aug 2025 18:08:34 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Christian Marangi <ansuelsmth@...il.com>
Cc: Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [net-next PATCH v2 1/2] net: phy: introduce
phy_id_compare_vendor() PHY ID helper
On Sat, Aug 23, 2025 at 03:44:28PM +0200, Christian Marangi wrote:
> Introduce phy_id_compare_vendor() PHY ID helper to compare a PHY ID with
> the PHY ID Vendor using the generic PHY ID Vendor mask.
>
> While at it also rework the PHY_ID_MATCH macro and move the mask to
> dedicated define so that PHY driver can make use of the mask if needed.
>
> Signed-off-by: Christian Marangi <ansuelsmth@...il.com>
Hi Christian
Reviewed-by: Andrew Lunn <andrew@...n.ch>
> +/**
> + * phy_id_compare_vendor - compare @id with @vendor mask
> + * @id: PHY ID
> + * @vendor_mask: PHY Vendor mask
> + *
> + * Return: true if the bits from @id match @vendor using the
> + * generic PHY Vendor mask.
> + */
> +static inline bool phy_id_compare_vendor(u32 id, u32 vendor_mask)
> +{
> + return phy_id_compare(id, vendor_mask, PHY_ID_MATCH_VENDOR_MASK);
> +}
> +
broadcom.c: if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610 ||
broadcom.c: BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610M) {
broadcom.c: if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM57780) {
broadcom.c: if ((BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610 ||
broadcom.c: BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610M) &&
broadcom.c: if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54210E ||
broadcom.c: BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54810 ||
broadcom.c: BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54811)
broadcom.c: if ((BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610 ||
broadcom.c: BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610M) &&
It looks like there is a use case of phy_id_compare_model(), if you
feel like adding it.
Andrew
Powered by blists - more mailing lists