We have currently three users of the PSEC_PER_SEC each of them defining it
individually. Instead, move it to time64.h to be available for everyone.
There is a new user coming with the same constant in use. It will also
make its life easier.
Signed-off-by: Andy Shevchenko
Acked-by: Heiko Stuebner
---
v2: added tag (Heiko), rebased on top of newest rc
Since it touches PHY stuff, I assume that the PHY tree is the best
to suck this.
drivers/net/ethernet/mscc/ocelot_ptp.c | 2 ++
drivers/phy/phy-core-mipi-dphy.c | 2 --
drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c | 8
include/soc/mscc/ocelot_ptp.h| 2 --
include/vdso/time64.h| 1 +
5 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/mscc/ocelot_ptp.c
b/drivers/net/ethernet/mscc/ocelot_ptp.c
index a33ab315cc6b..87ad2137ba06 100644
--- a/drivers/net/ethernet/mscc/ocelot_ptp.c
+++ b/drivers/net/ethernet/mscc/ocelot_ptp.c
@@ -4,6 +4,8 @@
* Copyright (c) 2017 Microsemi Corporation
* Copyright 2020 NXP
*/
+#include
+
#include
#include
#include
diff --git a/drivers/phy/phy-core-mipi-dphy.c b/drivers/phy/phy-core-mipi-dphy.c
index 14e0551cd319..77fe65367ce5 100644
--- a/drivers/phy/phy-core-mipi-dphy.c
+++ b/drivers/phy/phy-core-mipi-dphy.c
@@ -12,8 +12,6 @@
#include
#include
-#define PSEC_PER_SEC 1LL
-
/*
* Minimum D-PHY timings based on MIPI D-PHY specification. Derived
* from the valid ranges specified in Section 6.9, Table 14, Page 41
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
index 8af8c6c5cc02..347dc79a18c1 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
@@ -11,16 +11,16 @@
#include
#include
#include
+#include
#include
#include
#include
+#include
#include
+#include
+
#include
#include
-#include
-#include
-
-#define PSEC_PER_SEC 1LL
#define UPDATE(x, h, l)(((x) << (l)) & GENMASK((h), (l)))
diff --git a/include/soc/mscc/ocelot_ptp.h b/include/soc/mscc/ocelot_ptp.h
index 6a7388fa7cc5..ded497d72bdb 100644
--- a/include/soc/mscc/ocelot_ptp.h
+++ b/include/soc/mscc/ocelot_ptp.h
@@ -37,8 +37,6 @@ enum {
#define PTP_CFG_MISC_PTP_ENBIT(2)
-#define PSEC_PER_SEC 1LL
-
#define PTP_CFG_CLK_ADJ_CFG_ENABIT(0)
#define PTP_CFG_CLK_ADJ_CFG_DIRBIT(1)
diff --git a/include/vdso/time64.h b/include/vdso/time64.h
index 9d43c3f5e89d..b40cfa2aa33c 100644
--- a/include/vdso/time64.h
+++ b/include/vdso/time64.h
@@ -9,6 +9,7 @@
#define NSEC_PER_MSEC 100L
#define USEC_PER_SEC 100L
#define NSEC_PER_SEC 10L
+#define PSEC_PER_SEC 1LL
#define FSEC_PER_SEC 1000LL
#endif /* __VDSO_TIME64_H */
--
2.30.2