Re: [PATCH net-next v4 2/2] net: phy: micrel: Add PTP support for lan8842

From: Russell King (Oracle)
Date: Thu Aug 28 2025 - 04:28:08 EST


Hi,

Just a few comments.

On Thu, Aug 28, 2025 at 09:34:25AM +0200, Horatiu Vultur wrote:
> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> index 9a90818481320..95ba1a2859a9a 100644
> --- a/drivers/net/phy/micrel.c
> +++ b/drivers/net/phy/micrel.c
> @@ -457,6 +457,9 @@ struct lan8842_phy_stats {
>
> struct lan8842_priv {
> struct lan8842_phy_stats phy_stats;
> + int rev;

Maybe make this a u16 and move it at the end of the struct?

> + struct phy_device *phydev;

Why do you need this member? In this patch, you initialise this, but
never use it.

> @@ -5817,6 +5833,41 @@ static int lan8842_probe(struct phy_device *phydev)
> if (ret < 0)
> return ret;
>
> + /* Revision lan8832 doesn't have support for PTP, therefore don't add
> + * any PTP clocks
> + */
> + priv->rev = lanphy_read_page_reg(phydev, LAN8814_PAGE_COMMON_REGS,
> + LAN8842_SKU_REG);
> + if (priv->rev < 0)
> + return priv->rev;

ret = lanphy_read_page_reg(phydev, LAN8814_PAGE_COMMON_REGS,
LAN8842_SKU_REG);
if (ret < 0)
return ret;

priv->rev = ret;

Thanks.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!