]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethernet: ti: cpts: fix ethtool output when no ptp_clock registered
authorGrygorii Strashko <grygorii.strashko@ti.com>
Thu, 24 Dec 2020 16:24:05 +0000 (18:24 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 28 Dec 2020 21:32:34 +0000 (13:32 -0800)
commit1096f57add685510c513181e9bb4e58cd20b5328
tree021179a47711a66b7afaec858b327b343c5fed28
parente00e3e7f7f8194584f7839959a496b8a5bc0ac79
net: ethernet: ti: cpts: fix ethtool output when no ptp_clock registered

The CPTS driver registers PTP PHC clock when first netif is going up and
unregister it when all netif are down. Now ethtool will show:
 - PTP PHC clock index 0 after boot until first netif is up;
 - the last assigned PTP PHC clock index even if PTP PHC clock is not
registered any more after all netifs are down.

This patch ensures that -1 is returned by ethtool when PTP PHC clock is not
registered any more.

Fixes: a6768280e076 ("net: ethernet: ti: cpts: rework initialization/deinitialization")
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Link: https://lore.kernel.org/r/20201224162405.28032-1-grygorii.strashko@ti.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/ti/cpts.c