Skip to content

Commit 394c058

Browse files
committed
subsys: 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 582fdf7 commit 394c058

File tree

28 files changed

+48
-65
lines changed

28 files changed

+48
-65
lines changed

samples/subsys/pm/device_pm/src/dummy_driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,6 @@ int dummy_init(const struct device *dev)
114114

115115
PM_DEVICE_DEFINE(dummy_driver, dummy_device_pm_action);
116116

117-
DEVICE_DEFINE(dummy_driver, DUMMY_DRIVER_NAME, &dummy_init,
117+
DEVICE_INSTANCE(dummy_driver, &dummy_init,
118118
PM_DEVICE_GET(dummy_driver), NULL, NULL, POST_KERNEL,
119-
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &funcs);
119+
&funcs);

samples/subsys/pm/device_pm/src/dummy_parent.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ int dummy_parent_init(const struct device *dev)
5151

5252
PM_DEVICE_DEFINE(dummy_parent, dummy_parent_pm_action);
5353

54-
DEVICE_DEFINE(dummy_parent, DUMMY_PARENT_NAME, &dummy_parent_init,
54+
DEVICE_INSTANCE(dummy_parent, &dummy_parent_init,
5555
PM_DEVICE_GET(dummy_parent), NULL, NULL, POST_KERNEL,
56-
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &funcs);
56+
&funcs);

samples/subsys/pm/latency/src/test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ int dev_test_init(const struct device *dev)
5959

6060
static struct dev_test_data data;
6161

62-
DEVICE_DEFINE(dev_test, "dev_test", &dev_test_init, NULL, &data, NULL,
63-
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &dev_test_api);
62+
DEVICE_INSTANCE(dev_test, &dev_test_init, NULL, &data, NULL,
63+
POST_KERNEL, &dev_test_api);

samples/subsys/rtio/sensor_batch_processing/src/vnd_sensor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ static const struct rtio_iodev_api vnd_sensor_iodev_api = {
145145
}, \
146146
}; \
147147
\
148-
DEVICE_DT_INST_DEFINE(n, vnd_sensor_init, NULL, &vnd_sensor_data_##n, \
148+
DEVICE_INSTANCE_FROM_DT_INST(n, vnd_sensor_init, NULL, &vnd_sensor_data_##n, \
149149
&vnd_sensor_config_##n, POST_KERNEL, \
150-
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, NULL);
150+
NULL);
151151

152152
DT_INST_FOREACH_STATUS_OKAY(VND_SENSOR_INIT)

samples/userspace/prod_consumer/src/sample_driver_foo.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ static int sample_driver_foo_init(const struct device *dev)
108108

109109
static struct sample_driver_foo_dev_data sample_driver_foo_dev_data_0;
110110

111-
DEVICE_DEFINE(sample_driver_foo_0, SAMPLE_DRIVER_NAME_0,
112-
&sample_driver_foo_init, NULL,
111+
DEVICE_INSTANCE(sample_driver_foo_0, &sample_driver_foo_init, NULL,
113112
&sample_driver_foo_dev_data_0, NULL,
114-
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
115-
&sample_driver_foo_api);
113+
POST_KERNEL, &sample_driver_foo_api);

subsys/bluetooth/controller/coex/coex_ticker.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,5 +202,5 @@ static struct coex_ticker_config config = {
202202
};
203203
static struct coex_ticker_data data;
204204

205-
DEVICE_DT_INST_DEFINE(0, &coex_ticker_init, NULL, &data, &config,
206-
POST_KERNEL, 90, NULL);
205+
DEVICE_INSTANCE_FROM_DT_INST(0, &coex_ticker_init, NULL, &data, &config,
206+
POST_KERNEL, NULL);

subsys/bluetooth/controller/hci/hci_driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,8 +908,8 @@ static const struct bt_hci_driver_api hci_driver_api = {
908908

909909
#define BT_HCI_CONTROLLER_INIT(inst) \
910910
static struct hci_driver_data data_##inst; \
911-
DEVICE_DT_INST_DEFINE(inst, NULL, NULL, &data_##inst, NULL, POST_KERNEL, \
912-
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &hci_driver_api)
911+
DEVICE_INSTANCE_FROM_DT_INST(inst, NULL, NULL, &data_##inst, NULL, POST_KERNEL,\
912+
&hci_driver_api)
913913

914914
/* Only a single instance is supported */
915915
BT_HCI_CONTROLLER_INIT(0)

subsys/input/input_double_tap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static int double_tap_init(const struct device *dev)
119119
.double_tap_delay_ms = DT_INST_PROP(inst, double_tap_delay_ms), \
120120
}; \
121121
\
122-
DEVICE_DT_INST_DEFINE(inst, double_tap_init, NULL, NULL, &double_tap_config_##inst, \
123-
POST_KERNEL, CONFIG_INPUT_INIT_PRIORITY, NULL);
122+
DEVICE_INSTANCE_FROM_DT_INST(inst, double_tap_init, NULL, NULL, &double_tap_config_##inst, \
123+
POST_KERNEL, NULL);
124124

125125
DT_INST_FOREACH_STATUS_OKAY(INPUT_DOUBLE_TAP_DEFINE)

subsys/input/input_keymap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ static int keymap_init(const struct device *dev)
118118
\
119119
static struct keymap_data keymap_data_##inst; \
120120
\
121-
DEVICE_DT_INST_DEFINE(inst, keymap_init, NULL, \
121+
DEVICE_INSTANCE_FROM_DT_INST(inst, keymap_init, NULL, \
122122
&keymap_data_##inst, &keymap_config_##inst, \
123-
POST_KERNEL, CONFIG_INPUT_INIT_PRIORITY, NULL);
123+
POST_KERNEL, NULL);
124124

125125
DT_INST_FOREACH_STATUS_OKAY(INPUT_KEYMAP_DEFINE)

subsys/input/input_longpress.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ static int longpress_init(const struct device *dev)
136136
.long_delays_ms = DT_INST_PROP(inst, long_delay_ms), \
137137
}; \
138138
\
139-
DEVICE_DT_INST_DEFINE(inst, longpress_init, NULL, \
139+
DEVICE_INSTANCE_FROM_DT_INST(inst, longpress_init, NULL, \
140140
NULL, &longpress_config_##inst, \
141-
POST_KERNEL, CONFIG_INPUT_INIT_PRIORITY, NULL);
141+
POST_KERNEL, NULL);
142142

143143
DT_INST_FOREACH_STATUS_OKAY(INPUT_LONGPRESS_DEFINE)

0 commit comments

Comments
 (0)