device: convert DEVICE_INIT to DEVICE_DEFINE or SYS_DEVICE_DEFINE
Convert handful of users of DEVICE_INIT to DEVICE_DEFINE or SYS_DEVICE_DEFINE to allow deprecation of DEVICE_INIT. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
d439478805
commit
5e97d779bb
8 changed files with 28 additions and 24 deletions
|
@ -52,8 +52,10 @@ static const struct pwr_ctrl_cfg vdd_pwr_ctrl_cfg = {
|
||||||
.pin = VDD_PWR_CTRL_GPIO_PIN,
|
.pin = VDD_PWR_CTRL_GPIO_PIN,
|
||||||
};
|
};
|
||||||
|
|
||||||
DEVICE_INIT(vdd_pwr_ctrl_init, "", pwr_ctrl_init, NULL, &vdd_pwr_ctrl_cfg,
|
DEVICE_DEFINE(vdd_pwr_ctrl_init, "", pwr_ctrl_init, NULL, NULL,
|
||||||
POST_KERNEL, CONFIG_BOARD_VDD_PWR_CTRL_INIT_PRIORITY);
|
&vdd_pwr_ctrl_cfg,
|
||||||
|
POST_KERNEL, CONFIG_BOARD_VDD_PWR_CTRL_INIT_PRIORITY,
|
||||||
|
NULL);
|
||||||
|
|
||||||
#ifdef CONFIG_SENSOR
|
#ifdef CONFIG_SENSOR
|
||||||
|
|
||||||
|
@ -70,8 +72,8 @@ static const struct pwr_ctrl_cfg ccs_vdd_pwr_ctrl_cfg = {
|
||||||
.pin = CCS_VDD_PWR_CTRL_GPIO_PIN,
|
.pin = CCS_VDD_PWR_CTRL_GPIO_PIN,
|
||||||
};
|
};
|
||||||
|
|
||||||
DEVICE_INIT(ccs_vdd_pwr_ctrl_init, "", pwr_ctrl_init, NULL,
|
DEVICE_DEFINE(ccs_vdd_pwr_ctrl_init, "", pwr_ctrl_init, NULL, NULL,
|
||||||
&ccs_vdd_pwr_ctrl_cfg, POST_KERNEL,
|
&ccs_vdd_pwr_ctrl_cfg, POST_KERNEL,
|
||||||
CONFIG_BOARD_CCS_VDD_PWR_CTRL_INIT_PRIORITY);
|
CONFIG_BOARD_CCS_VDD_PWR_CTRL_INIT_PRIORITY, NULL);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -649,6 +649,6 @@ static int gpio_stm32_afio_init(const struct device *device)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(gpio_stm32_afio, "", gpio_stm32_afio_init, NULL, NULL, PRE_KERNEL_2, 0);
|
SYS_DEVICE_DEFINE("gpio_stm32_afio", gpio_stm32_afio_init, NULL, PRE_KERNEL_2, 0);
|
||||||
|
|
||||||
#endif /* CONFIG_SOC_SERIES_STM32F1X */
|
#endif /* CONFIG_SOC_SERIES_STM32F1X */
|
||||||
|
|
|
@ -402,9 +402,10 @@ static int stm32_exti_init(const struct device *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct stm32_exti_data exti_data;
|
static struct stm32_exti_data exti_data;
|
||||||
DEVICE_INIT(exti_stm32, STM32_EXTI_NAME, stm32_exti_init,
|
DEVICE_DEFINE(exti_stm32, STM32_EXTI_NAME, stm32_exti_init,
|
||||||
&exti_data, NULL,
|
NULL, &exti_data, NULL,
|
||||||
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||||
|
NULL);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief set & unset for the interrupt callbacks
|
* @brief set & unset for the interrupt callbacks
|
||||||
|
|
|
@ -413,6 +413,7 @@ static int sam0_eic_init(const struct device *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct sam0_eic_data eic_data;
|
static struct sam0_eic_data eic_data;
|
||||||
DEVICE_INIT(sam0_eic, DT_INST_LABEL(0), sam0_eic_init,
|
DEVICE_DEFINE(sam0_eic, DT_INST_LABEL(0), sam0_eic_init,
|
||||||
&eic_data, NULL,
|
NULL, &eic_data, NULL,
|
||||||
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||||
|
NULL);
|
||||||
|
|
|
@ -789,5 +789,5 @@ static int gsm_init(const struct device *device)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(gsm_ppp, GSM_MODEM_DEVICE_NAME, gsm_init, &gsm, NULL, POST_KERNEL,
|
DEVICE_DEFINE(gsm_ppp, GSM_MODEM_DEVICE_NAME, gsm_init, &gsm, NULL, NULL,
|
||||||
CONFIG_MODEM_GSM_INIT_PRIORITY);
|
POST_KERNEL, CONFIG_MODEM_GSM_INIT_PRIORITY, NULL);
|
||||||
|
|
|
@ -263,8 +263,8 @@ static int hci_spi_init(const struct device *unused)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(hci_spi, "hci_spi", &hci_spi_init, NULL, NULL,
|
SYS_DEVICE_DEFINE("hci_spi", hci_spi_init, NULL,
|
||||||
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -323,8 +323,8 @@ static int hci_uart_init(const struct device *unused)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICE_INIT(hci_uart, "hci_uart", &hci_uart_init, NULL, NULL,
|
SYS_DEVICE_DEFINE("hci_uart", hci_uart_init, NULL,
|
||||||
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,9 +41,9 @@ static struct ipm_console_sender_config_info sender_config = {
|
||||||
.bind_to = "ipm_dummy0",
|
.bind_to = "ipm_dummy0",
|
||||||
.flags = SOURCE
|
.flags = SOURCE
|
||||||
};
|
};
|
||||||
DEVICE_INIT(ipm_console_send0, "ipm_send0", ipm_console_sender_init,
|
DEVICE_DEFINE(ipm_console_send0, "ipm_send0", ipm_console_sender_init,
|
||||||
NULL, &sender_config,
|
NULL, NULL, &sender_config,
|
||||||
APPLICATION, INIT_PRIO_IPM_SEND);
|
APPLICATION, INIT_PRIO_IPM_SEND, NULL);
|
||||||
|
|
||||||
/* Receiving side of the console IPM driver. These numbers are
|
/* Receiving side of the console IPM driver. These numbers are
|
||||||
* more or less arbitrary
|
* more or less arbitrary
|
||||||
|
@ -67,9 +67,9 @@ static struct ipm_console_receiver_config_info receiver_config = {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ipm_console_receiver_runtime_data receiver_data;
|
struct ipm_console_receiver_runtime_data receiver_data;
|
||||||
DEVICE_INIT(ipm_console_recv0, "ipm_recv0", ipm_console_receiver_init,
|
DEVICE_DEFINE(ipm_console_recv0, "ipm_recv0", ipm_console_receiver_init,
|
||||||
&receiver_data, &receiver_config,
|
NULL, &receiver_data, &receiver_config,
|
||||||
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, NULL);
|
||||||
|
|
||||||
static const char thestr[] = "everything is awesome\n";
|
static const char thestr[] = "everything is awesome\n";
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue