Skip to content

Commit d76d711

Browse files
pdgendtkartben
authored andcommitted
drivers: ptp_clock: Place API into iterable section
Add wrapper DEVICE_API macro to all ptp_clock_driver_api instances. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent 47ed71a commit d76d711

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

drivers/ethernet/eth_e1000.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ static int ptp_clock_e1000_rate_adjust(const struct device *dev, double ratio)
411411
return 0;
412412
}
413413

414-
static const struct ptp_clock_driver_api api = {
414+
static DEVICE_API(ptp_clock, api) = {
415415
.set = ptp_clock_e1000_set,
416416
.get = ptp_clock_e1000_get,
417417
.adjust = ptp_clock_e1000_adjust,

drivers/ethernet/eth_native_posix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ static int ptp_clock_rate_adjust_native_posix(const struct device *clk,
560560
return 0;
561561
}
562562

563-
static const struct ptp_clock_driver_api api = {
563+
static DEVICE_API(ptp_clock, api) = {
564564
.set = ptp_clock_set_native_posix,
565565
.get = ptp_clock_get_native_posix,
566566
.adjust = ptp_clock_adjust_native_posix,

drivers/ethernet/eth_sam_gmac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2398,7 +2398,7 @@ static int ptp_clock_sam_gmac_rate_adjust(const struct device *dev,
23982398
return -ENOTSUP;
23992399
}
24002400

2401-
static const struct ptp_clock_driver_api ptp_api = {
2401+
static DEVICE_API(ptp_clock, ptp_api) = {
24022402
.set = ptp_clock_sam_gmac_set,
24032403
.get = ptp_clock_sam_gmac_get,
24042404
.adjust = ptp_clock_sam_gmac_adjust,

drivers/ethernet/eth_stm32_hal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,7 @@ static int ptp_clock_stm32_rate_adjust(const struct device *dev, double ratio)
15091509
return ret;
15101510
}
15111511

1512-
static const struct ptp_clock_driver_api api = {
1512+
static DEVICE_API(ptp_clock, api) = {
15131513
.set = ptp_clock_stm32_set,
15141514
.get = ptp_clock_stm32_get,
15151515
.adjust = ptp_clock_stm32_adjust,

drivers/ethernet/eth_xmc4xxx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ static int eth_xmc4xxx_ptp_clock_rate_adjust(const struct device *dev, double ra
11131113
return 0;
11141114
}
11151115

1116-
static const struct ptp_clock_driver_api ptp_api_xmc4xxx = {
1116+
static DEVICE_API(ptp_clock, ptp_api_xmc4xxx) = {
11171117
.set = eth_xmc4xxx_ptp_clock_set,
11181118
.get = eth_xmc4xxx_ptp_clock_get,
11191119
.adjust = eth_xmc4xxx_ptp_clock_adjust,

drivers/ethernet/nxp_enet/eth_mcux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1711,7 +1711,7 @@ static int ptp_clock_mcux_rate_adjust(const struct device *dev, double ratio)
17111711
return 0;
17121712
}
17131713

1714-
static const struct ptp_clock_driver_api api = {
1714+
static DEVICE_API(ptp_clock, api) = {
17151715
.set = ptp_clock_mcux_set,
17161716
.get = ptp_clock_mcux_get,
17171717
.adjust = ptp_clock_mcux_adjust,

drivers/ptp_clock/ptp_clock_nxp_enet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static void ptp_clock_nxp_enet_isr(const struct device *dev)
225225
irq_unlock(irq_lock_key);
226226
}
227227

228-
static const struct ptp_clock_driver_api ptp_clock_nxp_enet_api = {
228+
static DEVICE_API(ptp_clock, ptp_clock_nxp_enet_api) = {
229229
.set = ptp_clock_nxp_enet_set,
230230
.get = ptp_clock_nxp_enet_get,
231231
.adjust = ptp_clock_nxp_enet_adjust,

tests/net/ptp/clock/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static int my_ptp_clock_rate_adjust(const struct device *dev, double ratio)
226226
static struct ptp_context ptp_test_1_context;
227227
static struct ptp_context ptp_test_2_context;
228228

229-
static const struct ptp_clock_driver_api api = {
229+
static DEVICE_API(ptp_clock, api) = {
230230
.set = my_ptp_clock_set,
231231
.get = my_ptp_clock_get,
232232
.adjust = my_ptp_clock_adjust,

0 commit comments

Comments
 (0)