[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ym1N2sINE0A6WchK@lunn.ch>
Date: Sat, 30 Apr 2022 16:55:22 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Jonathan Lemon <jonathan.lemon@...il.com>
Cc: f.fainelli@...il.com, bcm-kernel-feedback-list@...adcom.com,
hkallweit1@...il.com, richardcochran@...il.com, lasse@...ebeat.app,
netdev@...r.kernel.org, kernel-team@...com
Subject: Re: [PATCH net-next v2 1/3] net: phy: broadcom: Add PTP support for
some Broadcom PHYs.
> +struct bcm_ptp_private *bcm_ptp_probe(struct phy_device *phydev)
> +{
> + struct bcm_ptp_private *priv;
> + struct ptp_clock *clock;
> +
> + switch (BRCM_PHY_MODEL(phydev)) {
> + case PHY_ID_BCM54210E:
> + break;
> + default:
> + return NULL;
> + }
> +
> + priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL);
> + if (!priv)
> + return ERR_PTR(-ENOMEM);
> +
> + priv->ptp_info = bcm_ptp_clock_info;
> +
> + clock = ptp_clock_register(&priv->ptp_info, &phydev->mdio.dev);
> + if (IS_ERR(clock))
> + return (void *)clock;
nit-pick:
You could use ERR_CAST() here.
Andrew
Powered by blists - more mailing lists