Re: [PATCH] net/ethernet: update ret when ptp_clock is ERROR

From: Richard Cochran
Date: Sat Nov 07 2020 - 10:07:14 EST


On Fri, Nov 06, 2020 at 01:34:04PM +0200, Grygorii Strashko wrote:
> And ptp_clock_register() can return NULL only if PTP support is disabled.

Not true in general ...

> In which case, we should not even get here.

only because the Kconfig uses "depends on" instead of "implies"
PTP_1588_CLOCK.

> So, I'd propose to s/IS_ERR_OR_NULL/IS_ERR above,
> and just assign ret = PTR_ERR(cpts->ptp_clock) here.

No, please no -- don't make another bad example for people to
copy/paste.

Thanks,
Richard