drivers: Convert to use new DEVICE_DT_INST_* macros

Move users that are DEVICE_DT_DECLARE(DT_DRV_INST(n, ...)) to
DEVICE_DT_INST_DECLARE(n, ...) and similar for DEVICE_DT_DEFINE.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-12-02 11:28:51 -06:00 committed by Kumar Gala
commit 06a5946266
7 changed files with 11 additions and 11 deletions

View file

@ -883,7 +883,7 @@ static const struct qspi_nor_config flash_id = {
.size = INST_0_BYTES, .size = INST_0_BYTES,
}; };
DEVICE_DT_DEFINE(DT_DRV_INST(0), &qspi_nor_init, device_pm_control_nop, DEVICE_DT_INST_DEFINE(0, &qspi_nor_init, device_pm_control_nop,
&qspi_nor_memory_data, &flash_id, &qspi_nor_memory_data, &flash_id,
POST_KERNEL, CONFIG_NORDIC_QSPI_NOR_INIT_PRIORITY, POST_KERNEL, CONFIG_NORDIC_QSPI_NOR_INIT_PRIORITY,
&qspi_nor_api); &qspi_nor_api);

View file

@ -281,7 +281,7 @@ static int nrf_flash_init(const struct device *dev)
return 0; return 0;
} }
DEVICE_DT_DEFINE(DT_DRV_INST(0), nrf_flash_init, device_pm_control_nop, DEVICE_DT_INST_DEFINE(0, nrf_flash_init, device_pm_control_nop,
NULL, NULL, NULL, NULL,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&flash_nrf_api); &flash_nrf_api);

View file

@ -1039,7 +1039,7 @@ static const struct spi_nor_config spi_nor_config_0 = {
static struct spi_nor_data spi_nor_data_0; static struct spi_nor_data spi_nor_data_0;
DEVICE_DT_DEFINE(DT_DRV_INST(0), &spi_nor_init, device_pm_control_nop, DEVICE_DT_INST_DEFINE(0, &spi_nor_init, device_pm_control_nop,
&spi_nor_data_0, &spi_nor_config_0, &spi_nor_data_0, &spi_nor_config_0,
POST_KERNEL, CONFIG_SPI_NOR_INIT_PRIORITY, POST_KERNEL, CONFIG_SPI_NOR_INIT_PRIORITY,
&spi_nor_api); &spi_nor_api);

View file

@ -666,7 +666,7 @@ static struct sx1509b_drv_data sx1509b_drvdata = {
.lock = Z_SEM_INITIALIZER(sx1509b_drvdata.lock, 1, 1), .lock = Z_SEM_INITIALIZER(sx1509b_drvdata.lock, 1, 1),
}; };
DEVICE_DT_DEFINE(DT_DRV_INST(0), sx1509b_init, device_pm_control_nop, DEVICE_DT_INST_DEFINE(0, sx1509b_init, device_pm_control_nop,
&sx1509b_drvdata, &sx1509b_cfg, &sx1509b_drvdata, &sx1509b_cfg,
POST_KERNEL, CONFIG_GPIO_SX1509B_INIT_PRIORITY, POST_KERNEL, CONFIG_GPIO_SX1509B_INIT_PRIORITY,
&api_table); &api_table);

View file

@ -386,7 +386,7 @@ static const struct driver_config regulator_##id##_cfg = { \
\ \
static struct REG_DATA_TAG(id) regulator_##id##_data; \ static struct REG_DATA_TAG(id) regulator_##id##_data; \
\ \
DEVICE_DT_DEFINE(DT_DRV_INST(id), REG_INIT(id), device_pm_control_nop, \ DEVICE_DT_INST_DEFINE(id, REG_INIT(id), device_pm_control_nop, \
&regulator_##id##_data, &regulator_##id##_cfg, \ &regulator_##id##_data, &regulator_##id##_cfg, \
POST_KERNEL, CONFIG_REGULATOR_FIXED_INIT_PRIORITY, \ POST_KERNEL, CONFIG_REGULATOR_FIXED_INIT_PRIORITY, \
&REG_API(id)); &REG_API(id));

View file

@ -593,7 +593,7 @@ out:
static struct ccs811_data ccs811_driver; static struct ccs811_data ccs811_driver;
DEVICE_DT_DEFINE(DT_DRV_INST(0), ccs811_init, device_pm_control_nop, DEVICE_DT_INST_DEFINE(0, ccs811_init, device_pm_control_nop,
&ccs811_driver, NULL, &ccs811_driver, NULL,
POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY,
&ccs811_driver_api); &ccs811_driver_api);

View file

@ -52,7 +52,7 @@ BUILD_ASSERT((PROP(hw_flow_control) && HW_FLOW_CONTROL_AVAILABLE) ||
static NRF_UART_Type *const uart0_addr = (NRF_UART_Type *)DT_INST_REG_ADDR(0); static NRF_UART_Type *const uart0_addr = (NRF_UART_Type *)DT_INST_REG_ADDR(0);
DEVICE_DT_DECLARE(DT_DRV_INST(0)); DEVICE_DT_INST_DECLARE(0);
/* Device data structure */ /* Device data structure */
struct uart_nrfx_data { struct uart_nrfx_data {
@ -1195,7 +1195,7 @@ static struct uart_nrfx_data uart_nrfx_uart0_data = {
} }
}; };
DEVICE_DT_DEFINE(DT_DRV_INST(0), DEVICE_DT_INST_DEFINE(0,
uart_nrfx_init, uart_nrfx_init,
uart_nrfx_pm_control, uart_nrfx_pm_control,
&uart_nrfx_uart0_data, &uart_nrfx_uart0_data,