Re: [PATCH net-next v2] ptp: Return -EINVAL on ptp_clock_register if required ops are NULL

From: Richard Cochran

Date: Wed Nov 05 2025 - 07:26:55 EST


On Tue, Nov 04, 2025 at 02:59:15PM -0800, Tim Hostetler wrote:
> ptp_clock should never be registered unless it stubs one of gettimex64()
> or gettime64() and settime64(). WARN_ON_ONCE and error out if either set
> of function pointers is null.
>
> For consistency, n_alarm validation is also folded into the
> WARN_ON_ONCE.
>
> Suggested-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
> Reviewed-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
> Reviewed-by: Harshitha Ramamurthy <hramamurthy@xxxxxxxxxx>
> Reviewed-by: Vadim Fedorenko <vadim.fedorenko@xxxxxxxxx>
> Signed-off-by: Tim Hostetler <thostet@xxxxxxxxxx>

Acked-by: Richard Cochran <richardcochran@xxxxxxxxx>