Skip to content

Commit e4b5930

Browse files
committed
drivers: Switching DEVICE_<DT/DT_INST>_DEFINE macros to new ones
Switching to DEVICE_INSTANCE and DEVICE_INSTANCE_FROM_DT_INST, thus merging former DEVICE_DEFINE and DEVICE_DT_DEFINE into one, so removing the name parameter from the earier and finally removing the prio parameter on all. Signed-off-by: Tomasz Bursztyka <[email protected]>
1 parent 21a4bfe commit e4b5930

File tree

1,040 files changed

+2133
-2847
lines changed

Some content is hidden

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

1,040 files changed

+2133
-2847
lines changed

drivers/adc/adc_ad559x.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,7 @@ static int adc_ad559x_init(const struct device *dev)
313313
\
314314
static struct adc_ad559x_data adc_ad559x_data##inst; \
315315
\
316-
DEVICE_DT_INST_DEFINE(inst, adc_ad559x_init, NULL, &adc_ad559x_data##inst, \
317-
&adc_ad559x_config##inst, POST_KERNEL, CONFIG_MFD_INIT_PRIORITY, \
318-
&adc_ad559x_api##inst);
316+
DEVICE_INSTANCE_FROM_DT_INST(inst, adc_ad559x_init, NULL, &adc_ad559x_data##inst, \
317+
&adc_ad559x_config##inst, POST_KERNEL, &adc_ad559x_api##inst);
319318

320319
DT_INST_FOREACH_STATUS_OKAY(ADC_AD559X_DEFINE)

drivers/adc/adc_ads1112.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ static const struct adc_driver_api api = {
387387
#define ADC_ADS1112_INST_DEFINE(n) \
388388
static const struct ads1112_config config_##n = {.bus = I2C_DT_SPEC_INST_GET(n)}; \
389389
static struct ads1112_data data_##n; \
390-
DEVICE_DT_INST_DEFINE(n, ads1112_init, NULL, &data_##n, &config_##n, POST_KERNEL, \
391-
CONFIG_ADC_INIT_PRIORITY, &api);
390+
DEVICE_INSTANCE_FROM_DT_INST(n, ads1112_init, NULL, &data_##n, &config_##n, POST_KERNEL, \
391+
&api);
392392

393393
DT_INST_FOREACH_STATUS_OKAY(ADC_ADS1112_INST_DEFINE);

drivers/adc/adc_ads1119.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,8 @@ static const struct adc_driver_api api = {
499499
IF_ENABLED(CONFIG_ADC_ASYNC, (.stack = thread_stack_##n)) \
500500
}; \
501501
static struct ads1119_data data_##n; \
502-
DEVICE_DT_INST_DEFINE(n, ads1119_init, \
503-
NULL, &data_##n, &config_##n, \
504-
POST_KERNEL, CONFIG_ADC_INIT_PRIORITY, \
505-
&api);
502+
DEVICE_INSTANCE_FROM_DT_INST(n, ads1119_init, \
503+
NULL, &data_##n, &config_##n, \
504+
POST_KERNEL, &api);
506505

507506
DT_INST_FOREACH_STATUS_OKAY(ADC_ADS1119_INST_DEFINE);

drivers/adc/adc_ads114s0x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,7 @@ BUILD_ASSERT(CONFIG_ADC_INIT_PRIORITY > CONFIG_SPI_INIT_PRIORITY,
15021502
.vbias_level = DT_INST_PROP(n, vbias_level), \
15031503
}; \
15041504
static struct ads114s0x_data data_##n; \
1505-
DEVICE_DT_INST_DEFINE(n, ads114s0x_init, NULL, &data_##n, &config_##n, POST_KERNEL, \
1506-
CONFIG_ADC_INIT_PRIORITY, &api);
1505+
DEVICE_INSTANCE_FROM_DT_INST(n, ads114s0x_init, NULL, &data_##n, &config_##n, POST_KERNEL, \
1506+
&api);
15071507

15081508
DT_INST_FOREACH_STATUS_OKAY(ADC_ADS114S0X_INST_DEFINE);

drivers/adc/adc_ads1x1x.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,9 +818,8 @@ static const struct adc_driver_api ads1x1x_api = {
818818
ADC_CONTEXT_INIT_TIMER(ads##t##_data_##n, ctx), \
819819
ADC_CONTEXT_INIT_SYNC(ads##t##_data_##n, ctx), \
820820
}; \
821-
DEVICE_DT_DEFINE(DT_INST_ADS1X1X(n, t), ads1x1x_init, NULL, &ads##t##_data_##n, \
822-
&ads##t##_config_##n, POST_KERNEL, CONFIG_ADC_ADS1X1X_INIT_PRIORITY, \
823-
&ads1x1x_api);
821+
DEVICE_INSTANCE(DT_INST_ADS1X1X(n, t), ads1x1x_init, NULL, &ads##t##_data_##n, \
822+
&ads##t##_config_##n, POST_KERNEL, &ads1x1x_api);
824823

825824
/* The ADS111X provides 16 bits of data in binary two's complement format
826825
* A positive full-scale (+FS) input produces an output code of 7FFFh and a

drivers/adc/adc_ads7052.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ static const struct adc_driver_api ads7052_api = {
308308
ADC_CONTEXT_INIT_SYNC(ads7052_data_##n, ctx), \
309309
}; \
310310
\
311-
DEVICE_DT_INST_DEFINE(n, adc_ads7052_init, NULL, &ads7052_data_##n, &ads7052_cfg_##n, \
312-
POST_KERNEL, CONFIG_ADC_ADS7052_INIT_PRIORITY, &ads7052_api);
311+
DEVICE_INSTANCE_FROM_DT_INST(n, adc_ads7052_init, NULL, &ads7052_data_##n, &ads7052_cfg_##n,\
312+
POST_KERNEL, &ads7052_api);
313313

314314
DT_INST_FOREACH_STATUS_OKAY(ADC_ADS7052_INIT)

drivers/adc/adc_ambiq.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,7 @@ static int adc_ambiq_pm_action(const struct device *dev, enum pm_device_action a
432432
.pwr_func = pwr_on_ambiq_adc_##n, \
433433
}; \
434434
PM_DEVICE_DT_INST_DEFINE(n, adc_ambiq_pm_action); \
435-
DEVICE_DT_INST_DEFINE(n, &adc_ambiq_init, PM_DEVICE_DT_INST_GET(n), &adc_ambiq_data_##n, \
436-
&adc_ambiq_config_##n, POST_KERNEL, CONFIG_ADC_INIT_PRIORITY, \
437-
&adc_ambiq_driver_api_##n);
435+
DEVICE_INSTANCE_FROM_DT_INST(n, &adc_ambiq_init, PM_DEVICE_DT_INST_GET(n), &adc_ambiq_data_##n,\
436+
&adc_ambiq_config_##n, POST_KERNEL, &adc_ambiq_driver_api_##n);
438437

439438
DT_INST_FOREACH_STATUS_OKAY(ADC_AMBIQ_INIT)

drivers/adc/adc_b91.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,7 @@ static const struct adc_driver_api adc_b91_driver_api = {
461461
.ref_internal = cfg_0.vref_internal_mv,
462462
};
463463

464-
DEVICE_DT_INST_DEFINE(0, adc_b91_init, NULL,
464+
DEVICE_INSTANCE_FROM_DT_INST(0, adc_b91_init, NULL,
465465
&data_0, &cfg_0,
466466
POST_KERNEL,
467-
CONFIG_ADC_INIT_PRIORITY,
468467
&adc_b91_driver_api);

drivers/adc/adc_cc13xx_cc26xx.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,10 @@ static const struct adc_driver_api cc13xx_cc26xx_driver_api = {
294294
ADC_CONTEXT_INIT_LOCK(adc_cc13xx_cc26xx_data_##index, ctx), \
295295
ADC_CONTEXT_INIT_SYNC(adc_cc13xx_cc26xx_data_##index, ctx), \
296296
}; \
297-
DEVICE_DT_INST_DEFINE(index, \
297+
DEVICE_INSTANCE_FROM_DT_INST(index, \
298298
&adc_cc13xx_cc26xx_init, NULL, \
299299
&adc_cc13xx_cc26xx_data_##index, \
300300
&adc_cc13xx_cc26xx_cfg_##index, POST_KERNEL, \
301-
CONFIG_ADC_INIT_PRIORITY, \
302301
&cc13xx_cc26xx_driver_api); \
303302
\
304303
static void adc_cc13xx_cc26xx_cfg_func_##index(void) \

drivers/adc/adc_cc32xx.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,9 @@ static const struct adc_driver_api cc32xx_driver_api = {
311311
ADC_CONTEXT_INIT_SYNC(adc_cc32xx_data_##index, ctx), \
312312
}; \
313313
\
314-
DEVICE_DT_INST_DEFINE(index, \
314+
DEVICE_INSTANCE_FROM_DT_INST(index, \
315315
&adc_cc32xx_init, NULL, &adc_cc32xx_data_##index, \
316316
&adc_cc32xx_cfg_##index, POST_KERNEL, \
317-
CONFIG_ADC_INIT_PRIORITY, \
318317
&cc32xx_driver_api); \
319318
\
320319
static void adc_cc32xx_cfg_func_##index(void) \

0 commit comments

Comments
 (0)