[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6fef3a00-6c18-b775-d1b4-dfd692261bd3@ti.com>
Date: Thu, 16 Apr 2020 14:11:45 +0300
From: Grygorii Strashko <grygorii.strashko@...com>
To: Clay McClure <clay@...mons.net>
CC: "David S. Miller" <davem@...emloft.net>,
Sekhar Nori <nsekhar@...com>,
Richard Cochran <richardcochran@...il.com>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net: cpts: Condition WARN_ON on PTP_1588_CLOCK
On 16/04/2020 11:56, Clay McClure wrote:
> CPTS_MOD merely implies PTP_1588_CLOCK; it is possible to build cpts
> without PTP clock support. In that case, ptp_clock_register() returns
> NULL and we should not WARN_ON(cpts->clock) when downing the interface.
> The ptp_*() functions are stubbed without PTP_1588_CLOCK, so it's safe
> to pass them a null pointer.
Could you explain the purpose of the exercise (Enabling CPTS with PTP_1588_CLOCK disabled), pls?
>
> Signed-off-by: Clay McClure <clay@...mons.net>
> ---
> drivers/net/ethernet/ti/cpts.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c
> index fd214f8730a9..daf4505f4a70 100644
> --- a/drivers/net/ethernet/ti/cpts.c
> +++ b/drivers/net/ethernet/ti/cpts.c
> @@ -646,7 +646,7 @@ EXPORT_SYMBOL_GPL(cpts_register);
>
> void cpts_unregister(struct cpts *cpts)
> {
> - if (WARN_ON(!cpts->clock))
> + if (IS_REACHABLE(PTP_1588_CLOCK) && WARN_ON(!cpts->clock))
> return;
>
> ptp_clock_unregister(cpts->clock);
>
--
Best regards,
grygorii
Powered by blists - more mailing lists