Re: [PATCH v2 net] net: phy: micrel: Fix warn: passing zero to PTR_ERR

From: Richard Cochran
Date: Thu Jul 21 2022 - 10:16:39 EST


On Wed, Jul 20, 2022 at 04:32:55AM +0000, Divya.Koppera@xxxxxxxxxxxxx wrote:

> static int lan8814_ptp_probe_once(struct phy_device *phydev)
> {
> struct lan8814_shared_priv *shared = phydev->shared->priv;
>
> if (!IS_ENABLED(CONFIG_PTP_1588_CLOCK) ||
> !IS_ENABLED(CONFIG_NETWORK_PHY_TIMESTAMPING))
> return 0;

It is weird to use macros here, but not before calling ptp_clock_register.
Make it consistent by checking shared->ptp_clock instead.
That is also better form.

Thanks,
Richard