Skip to content

Commit ee6f515

Browse files
pdgendtkartben
authored andcommitted
drivers: i2c: Place API into iterable section
Add wrapper DEVICE_API macro to all i2c_driver_api instances. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent 2d5f1ba commit ee6f515

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+54
-54
lines changed

drivers/i2c/gpio_i2c_switch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static int gpio_i2c_switch_transfer(const struct device *dev, struct i2c_msg *ms
6464
return res;
6565
}
6666

67-
static const struct i2c_driver_api gpio_i2c_switch_api_funcs = {
67+
static DEVICE_API(i2c, gpio_i2c_switch_api_funcs) = {
6868
.configure = gpio_i2c_switch_configure,
6969
.transfer = gpio_i2c_switch_transfer,
7070
#ifdef CONFIG_I2C_RTIO

drivers/i2c/i2c_ambiq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ static int i2c_ambiq_init(const struct device *dev)
381381
return ret;
382382
}
383383

384-
static const struct i2c_driver_api i2c_ambiq_driver_api = {
384+
static DEVICE_API(i2c, i2c_ambiq_driver_api) = {
385385
.configure = i2c_ambiq_configure,
386386
.transfer = i2c_ambiq_transfer,
387387
#if CONFIG_I2C_AMBIQ_BUS_RECOVERY

drivers/i2c/i2c_andes_atciic100.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ static void i2c_atciic100_irq_handler(void *arg)
732732
}
733733
}
734734

735-
static const struct i2c_driver_api i2c_atciic100_driver = {
735+
static DEVICE_API(i2c, i2c_atciic100_driver) = {
736736
.configure = (i2c_api_configure_t)i2c_atciic100_configure,
737737
.transfer = (i2c_api_full_io_t)i2c_atciic100_transfer,
738738
#if defined(CONFIG_I2C_TARGET)

drivers/i2c/i2c_b91.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static int i2c_b91_init(const struct device *dev)
147147
}
148148

149149
/* I2C driver APIs structure */
150-
static const struct i2c_driver_api i2c_b91_api = {
150+
static DEVICE_API(i2c, i2c_b91_api) = {
151151
.configure = i2c_b91_configure,
152152
.transfer = i2c_b91_transfer,
153153
#ifdef CONFIG_I2C_RTIO

drivers/i2c/i2c_bcm_iproc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ static int iproc_i2c_init(const struct device *dev)
916916
return 0;
917917
}
918918

919-
static const struct i2c_driver_api iproc_i2c_driver_api = {
919+
static DEVICE_API(i2c, iproc_i2c_driver_api) = {
920920
.configure = iproc_i2c_configure,
921921
.transfer = iproc_i2c_transfer_multi,
922922
#ifdef CONFIG_I2C_TARGET

drivers/i2c/i2c_cc13xx_cc26xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ static int i2c_cc13xx_cc26xx_init(const struct device *dev)
419419
return 0;
420420
}
421421

422-
static const struct i2c_driver_api i2c_cc13xx_cc26xx_driver_api = {
422+
static DEVICE_API(i2c, i2c_cc13xx_cc26xx_driver_api) = {
423423
.configure = i2c_cc13xx_cc26xx_configure,
424424
.transfer = i2c_cc13xx_cc26xx_transfer,
425425
#ifdef CONFIG_I2C_RTIO

drivers/i2c/i2c_cc32xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ static int i2c_cc32xx_init(const struct device *dev)
379379
return 0;
380380
}
381381

382-
static const struct i2c_driver_api i2c_cc32xx_driver_api = {
382+
static DEVICE_API(i2c, i2c_cc32xx_driver_api) = {
383383
.configure = i2c_cc32xx_configure,
384384
.transfer = i2c_cc32xx_transfer,
385385
#ifdef CONFIG_I2C_RTIO

drivers/i2c/i2c_dw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ static void i2c_dw_slave_read_clear_intr_bits(const struct device *dev)
10231023
}
10241024
#endif /* CONFIG_I2C_TARGET */
10251025

1026-
static const struct i2c_driver_api funcs = {
1026+
static DEVICE_API(i2c, funcs) = {
10271027
.configure = i2c_dw_runtime_configure,
10281028
.transfer = i2c_dw_transfer,
10291029
#ifdef CONFIG_I2C_TARGET

drivers/i2c/i2c_emul.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ static int i2c_emul_target_unregister(const struct device *dev, struct i2c_targe
292292

293293
/* Device instantiation */
294294

295-
static const struct i2c_driver_api i2c_emul_api = {
295+
static DEVICE_API(i2c, i2c_emul_api) = {
296296
.configure = i2c_emul_configure,
297297
.get_config = i2c_emul_get_config,
298298
.transfer = i2c_emul_transfer,

drivers/i2c/i2c_ene_kb1200.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ static int i2c_kb1200_transfer(const struct device *dev, struct i2c_msg *msgs, u
293293
}
294294

295295
/* I2C Master driver registration */
296-
static const struct i2c_driver_api i2c_kb1200_api = {
296+
static DEVICE_API(i2c, i2c_kb1200_api) = {
297297
.configure = i2c_kb1200_configure,
298298
.get_config = i2c_kb1200_get_config,
299299
.transfer = i2c_kb1200_transfer,

0 commit comments

Comments
 (0)