Skip to content

Commit 825aab3

Browse files
pabigotnashif
authored andcommitted
drivers: i2c_sifive: fix deprecation warnings
The init macro used outdated spellings for the instance-specific properties, resulting in build warnings when I2C was enabled. Signed-off-by: Peter A. Bigot <[email protected]>
1 parent b61574d commit 825aab3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/i2c/i2c_sifive.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -332,20 +332,19 @@ static struct i2c_driver_api i2c_sifive_api = {
332332

333333
#define I2C_SIFIVE_INIT(n) \
334334
static struct i2c_sifive_cfg i2c_sifive_cfg_##n = { \
335-
.base = DT_SIFIVE_I2C0_##n##_BASE_ADDRESS, \
336-
.f_sys = DT_SIFIVE_I2C0_##n##_INPUT_FREQUENCY, \
337-
.f_bus = DT_SIFIVE_I2C0_##n##_CLOCK_FREQUENCY, \
335+
.base = DT_INST_##n##_SIFIVE_I2C0_BASE_ADDRESS, \
336+
.f_sys = DT_INST_##n##_SIFIVE_I2C0_INPUT_FREQUENCY, \
337+
.f_bus = DT_INST_##n##_SIFIVE_I2C0_CLOCK_FREQUENCY, \
338338
}; \
339339
DEVICE_AND_API_INIT(i2c_##n, \
340-
DT_SIFIVE_I2C0_##n##_LABEL, \
340+
DT_INST_##n##_SIFIVE_I2C0_LABEL, \
341341
i2c_sifive_init, \
342342
NULL, \
343343
&i2c_sifive_cfg_##n, \
344344
POST_KERNEL, \
345345
CONFIG_I2C_INIT_PRIORITY, \
346346
&i2c_sifive_api)
347347

348-
#ifdef DT_INST_0_SIFIVE_I2C0_LABEL
348+
#ifdef DT_INST_0_SIFIVE_I2C0
349349
I2C_SIFIVE_INIT(0);
350350
#endif
351-

0 commit comments

Comments
 (0)