617d3e531324c55b6997cbbc675903157294313d
[openwrt/staging/ldir.git] /
1 From bbb23c33bbfc0fdb6098f0c61950f4a7c03379aa Mon Sep 17 00:00:00 2001
2 From: Yangbo Lu <yangbo.lu@nxp.com>
3 Date: Mon, 19 Jun 2017 18:46:04 +0800
4 Subject: [PATCH] dpaa_eth: move global variable 'clock' into ptp_priv_s struct
5
6 This patch is to move global variable 'clock' for DPAA PTP
7 clock pointer into ptp_priv_s struct.
8
9 Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
10 ---
11 drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h | 1 +
12 drivers/net/ethernet/freescale/sdk_dpaa/dpaa_ptp.c | 5 +++--
13 2 files changed, 4 insertions(+), 2 deletions(-)
14
15 --- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h
16 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h
17 @@ -669,6 +669,7 @@ static inline void _dpa_assign_wq(struct
18 struct ptp_priv_s {
19 struct device_node *node;
20 struct platform_device *of_dev;
21 + struct ptp_clock *clock;
22 struct mac_device *mac_dev;
23 };
24 extern struct ptp_priv_s ptp_priv;
25 --- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_ptp.c
26 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_ptp.c
27 @@ -27,8 +27,6 @@
28 #include "dpaa_eth.h"
29 #include "mac.h"
30
31 -struct ptp_clock *clock;
32 -
33 static struct mac_device *mac_dev;
34 static u32 freqCompensation;
35
36 @@ -256,6 +254,7 @@ static int __init __cold dpa_ptp_load(vo
37 {
38 struct device *ptp_dev;
39 struct timespec64 now;
40 + struct ptp_clock *clock = ptp_priv.clock;
41 int dpa_phc_index;
42 int err;
43
44 @@ -283,6 +282,8 @@ module_init(dpa_ptp_load);
45
46 static void __exit __cold dpa_ptp_unload(void)
47 {
48 + struct ptp_clock *clock = ptp_priv.clock;
49 +
50 if (mac_dev->fm_rtc_disable_interrupt)
51 mac_dev->fm_rtc_disable_interrupt(mac_dev->fm_dev, 0xffffffff);
52 ptp_clock_unregister(clock);