device: Remove DEVICE_DT_DECLARE / DEVICE_DT_INST_DECLARE
Now that we generate a header that extern's all possible devicetree based device struct we can remove DEVICE_DT_DECLARE and DEVICE_DT_INST_DECLARE as they aren't needed anymore. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
98b6e4f834
commit
02703e60d9
55 changed files with 2 additions and 160 deletions
|
@ -39,7 +39,6 @@ static int efr32mg_sltb004a_init(const struct device *dev)
|
|||
#define CCS811 DT_NODELABEL(ccs811)
|
||||
|
||||
#if DT_NODE_HAS_STATUS(CCS811, okay)
|
||||
DEVICE_DT_DECLARE(DT_GPIO_CTLR(CCS811, supply_gpios));
|
||||
cfg = (struct supply_cfg){
|
||||
.gpio = DEVICE_DT_GET(DT_GPIO_CTLR(CCS811, supply_gpios)),
|
||||
.pin = DT_GPIO_PIN(CCS811, supply_gpios),
|
||||
|
|
|
@ -14,7 +14,7 @@ static int frdm_k64f_pinmux_init(const struct device *dev)
|
|||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(porta), okay)
|
||||
__unused const struct device *porta =
|
||||
device_get_binding(DT_LABEL(DT_NODELABEL(porta)));
|
||||
DEVICE_DT_GET(DT_NODELABEL(porta));
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(portb), okay)
|
||||
__unused const struct device *portb =
|
||||
|
|
|
@ -51,9 +51,6 @@ struct adc_xec_regs {
|
|||
#define ADC_XEC_REG_BASE \
|
||||
((struct adc_xec_regs *)(DT_INST_REG_ADDR(0)))
|
||||
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static void adc_context_start_sampling(struct adc_context *ctx)
|
||||
{
|
||||
struct adc_xec_data *data = CONTAINER_OF(ctx, struct adc_xec_data, ctx);
|
||||
|
|
|
@ -239,8 +239,6 @@ static int adc_nrfx_read_async(const struct device *dev,
|
|||
}
|
||||
#endif /* CONFIG_ADC_ASYNC */
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static void event_handler(const nrfx_adc_evt_t *p_event)
|
||||
{
|
||||
const struct device *dev = DEVICE_DT_INST_GET(0);
|
||||
|
|
|
@ -390,8 +390,6 @@ static void saadc_irq_handler(const struct device *dev)
|
|||
}
|
||||
}
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static int init_saadc(const struct device *dev)
|
||||
{
|
||||
nrf_saadc_event_clear(NRF_SAADC, NRF_SAADC_EVENT_END);
|
||||
|
|
|
@ -110,8 +110,6 @@ static struct onoff_manager *get_onoff_manager(const struct device *dev,
|
|||
}
|
||||
|
||||
|
||||
DEVICE_DT_DECLARE(DT_NODELABEL(clock));
|
||||
|
||||
#define CLOCK_DEVICE DEVICE_DT_GET(DT_NODELABEL(clock))
|
||||
|
||||
struct onoff_manager *z_nrf_clock_control_get_onoff(clock_control_subsys_t sys)
|
||||
|
|
|
@ -332,8 +332,6 @@ static const struct counter_driver_api counter_gecko_driver_api = {
|
|||
|
||||
/* RTCC0 */
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
ISR_DIRECT_DECLARE(counter_gecko_isr_0)
|
||||
{
|
||||
const struct device *dev = DEVICE_DT_INST_GET(0);
|
||||
|
|
|
@ -665,7 +665,6 @@ static const struct counter_driver_api counter_nrfx_driver_api = {
|
|||
BUILD_ASSERT((RTC_PROP(idx, prescaler) - 1) <= \
|
||||
RTC_PRESCALER_PRESCALER_Msk, \
|
||||
"RTC prescaler out of range"); \
|
||||
DEVICE_DT_DECLARE(RTC(idx)); \
|
||||
static int counter_##idx##_init(const struct device *dev) \
|
||||
{ \
|
||||
IRQ_CONNECT(DT_IRQN(RTC(idx)), DT_IRQ(RTC(idx), priority), \
|
||||
|
|
|
@ -397,7 +397,6 @@ static const struct counter_driver_api counter_nrfx_driver_api = {
|
|||
BUILD_ASSERT(TIMER_PROP(idx, prescaler) <= \
|
||||
TIMER_PRESCALER_PRESCALER_Msk, \
|
||||
"TIMER prescaler out of range"); \
|
||||
DEVICE_DT_DECLARE(TIMER(idx)); \
|
||||
static int counter_##idx##_init(const struct device *dev) \
|
||||
{ \
|
||||
IRQ_CONNECT(DT_IRQN(TIMER(idx)), DT_IRQ(TIMER(idx), priority), \
|
||||
|
|
|
@ -362,8 +362,6 @@ static const struct dma_driver_api dw_dma_driver_api = {
|
|||
|
||||
#define DW_DMAC_INIT(inst) \
|
||||
\
|
||||
DEVICE_DT_INST_DECLARE(inst); \
|
||||
\
|
||||
static struct dw_drv_plat_data dmac##inst = { \
|
||||
.chan[0] = { \
|
||||
.class = 6, \
|
||||
|
|
|
@ -582,8 +582,6 @@ static const struct dma_driver_api pl330_driver_api = {
|
|||
.stop = dma_pl330_transfer_stop,
|
||||
};
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static const struct dma_pl330_config pl330_config = {
|
||||
.reg_base = DT_INST_REG_ADDR(0),
|
||||
#ifdef CONFIG_DMA_64BIT
|
||||
|
|
|
@ -396,8 +396,6 @@ static int dma_sam0_get_status(const struct device *dev, uint32_t channel,
|
|||
return 0;
|
||||
}
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
#define DMA_SAM0_IRQ_CONNECT(n) \
|
||||
do { \
|
||||
IRQ_CONNECT(DT_INST_IRQ_BY_IDX(0, n, irq), \
|
||||
|
|
|
@ -347,8 +347,6 @@ static const struct dma_driver_api sam_xdmac_driver_api = {
|
|||
|
||||
/* DMA0 */
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static void dma0_sam_irq_config(void)
|
||||
{
|
||||
IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority), sam_xdmac_isr,
|
||||
|
|
|
@ -683,8 +683,6 @@ static void dma_stm32_irq_##dma##_##chan(const struct device *dev) \
|
|||
|
||||
#if DT_NODE_HAS_STATUS(DT_DRV_INST(0), okay)
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
DMA_STM32_DEFINE_IRQ_HANDLER(0, 0);
|
||||
DMA_STM32_DEFINE_IRQ_HANDLER(0, 1);
|
||||
DMA_STM32_DEFINE_IRQ_HANDLER(0, 2);
|
||||
|
@ -732,8 +730,6 @@ DMA_STM32_INIT_DEV(0);
|
|||
|
||||
#if DT_NODE_HAS_STATUS(DT_DRV_INST(1), okay)
|
||||
|
||||
DEVICE_DT_INST_DECLARE(1);
|
||||
|
||||
DMA_STM32_DEFINE_IRQ_HANDLER(1, 0);
|
||||
DMA_STM32_DEFINE_IRQ_HANDLER(1, 1);
|
||||
DMA_STM32_DEFINE_IRQ_HANDLER(1, 2);
|
||||
|
|
|
@ -40,8 +40,6 @@ struct entropy_cc13xx_cc26xx_data {
|
|||
#endif
|
||||
};
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static inline struct entropy_cc13xx_cc26xx_data *
|
||||
get_dev_data(const struct device *dev)
|
||||
{
|
||||
|
|
|
@ -210,8 +210,6 @@ static void e1000_isr(const struct device *device)
|
|||
#define PCI_VENDOR_ID_INTEL 0x8086
|
||||
#define PCI_DEVICE_ID_I82540EM 0x100e
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
int e1000_probe(const struct device *device)
|
||||
{
|
||||
const pcie_bdf_t bdf = PCIE_BDF(0, 3, 0);
|
||||
|
|
|
@ -636,8 +636,6 @@ static const struct ethernet_api eth_api = {
|
|||
.send = eth_tx,
|
||||
};
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static void eth0_irq_config(void)
|
||||
{
|
||||
IRQ_CONNECT(DT_INST_IRQN(0),
|
||||
|
|
|
@ -2139,8 +2139,6 @@ static const struct ethernet_api eth_api = {
|
|||
#endif
|
||||
};
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static void eth0_irq_config(void)
|
||||
{
|
||||
IRQ_CONNECT(DT_INST_IRQ_BY_NAME(0, gmac, irq),
|
||||
|
|
|
@ -658,8 +658,6 @@ done:
|
|||
|
||||
/* Bindings to the platform */
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
int eth_init(const struct device *dev)
|
||||
{
|
||||
IRQ_CONNECT(DT_INST_IRQN(0),
|
||||
|
|
|
@ -318,8 +318,6 @@ static int eth_stellaris_dev_init(const struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static void eth_stellaris_irq_config(const struct device *dev)
|
||||
{
|
||||
/* Enable Interrupt. */
|
||||
|
|
|
@ -855,8 +855,6 @@ static const struct ethernet_api eth_api = {
|
|||
.send = eth_tx,
|
||||
};
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static void eth0_irq_config(void)
|
||||
{
|
||||
IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority), eth_isr,
|
||||
|
|
|
@ -217,8 +217,6 @@ static uint32_t gpio_cc13xx_cc26xx_get_pending_int(const struct device *dev)
|
|||
return GPIO_getEventMultiDio(GPIO_DIO_ALL_MASK);
|
||||
}
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static void gpio_cc13xx_cc26xx_isr(const struct device *dev)
|
||||
{
|
||||
struct gpio_cc13xx_cc26xx_data *data = dev->data;
|
||||
|
|
|
@ -275,7 +275,6 @@ static const struct gpio_driver_api api_funcs = {
|
|||
.port_num = n \
|
||||
}; \
|
||||
\
|
||||
DEVICE_DT_INST_DECLARE(n); \
|
||||
static struct gpio_cc32xx_data gpio_cc32xx_a##n##_data; \
|
||||
\
|
||||
GPIO_CC32XX_INIT_FUNC(n) \
|
||||
|
|
|
@ -265,8 +265,6 @@ static void gpio_esp32_fire_callbacks(const struct device *device)
|
|||
|
||||
static void gpio_esp32_isr(const void *param);
|
||||
|
||||
DEVICE_DT_DECLARE(DT_NODELABEL(pinmux));
|
||||
|
||||
static int gpio_esp32_init(const struct device *device)
|
||||
{
|
||||
struct gpio_esp32_data *data = device->data;
|
||||
|
|
|
@ -418,16 +418,6 @@ static uint32_t gpio_lpc11u6x_get_pending_int(const struct device *dev)
|
|||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio0), okay)
|
||||
DEVICE_DT_DECLARE(DT_NODELABEL(gpio0));
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio1), okay)
|
||||
DEVICE_DT_DECLARE(DT_NODELABEL(gpio1));
|
||||
#endif
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio2), okay)
|
||||
DEVICE_DT_DECLARE(DT_NODELABEL(gpio2));
|
||||
#endif
|
||||
|
||||
static void gpio_lpc11u6x_isr(const void *arg)
|
||||
{
|
||||
struct gpio_lpc11u6x_shared *shared =
|
||||
|
|
|
@ -396,13 +396,6 @@ static inline void fire_callbacks(const struct device *port, uint32_t pins)
|
|||
gpio_fire_callbacks(list, port, pins);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_GPIO_NRF_P0
|
||||
DEVICE_DT_DECLARE(GPIO(0));
|
||||
#endif
|
||||
#ifdef CONFIG_GPIO_NRF_P1
|
||||
DEVICE_DT_DECLARE(GPIO(1));
|
||||
#endif
|
||||
|
||||
static void gpiote_event_handler(void)
|
||||
{
|
||||
uint32_t fired_triggers[GPIO_COUNT] = {0};
|
||||
|
|
|
@ -23,8 +23,6 @@ LOG_MODULE_REGISTER(i2c_cc13xx_cc26xx);
|
|||
|
||||
#include "i2c-priv.h"
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
struct i2c_cc13xx_cc26xx_data {
|
||||
struct k_sem lock;
|
||||
struct k_sem complete;
|
||||
|
|
|
@ -579,8 +579,6 @@ static const struct i2c_driver_api i2c_esp32_driver_api = {
|
|||
};
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_DRV_INST(0), okay)
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static void i2c_esp32_connect_irq_0(void)
|
||||
{
|
||||
IRQ_CONNECT(CONFIG_I2C_ESP32_0_IRQ, 1, i2c_esp32_isr,
|
||||
|
@ -625,8 +623,6 @@ DEVICE_DT_INST_DEFINE(0, &i2c_esp32_init, device_pm_control_nop,
|
|||
#endif /* DT_NODE_HAS_STATUS(DT_DRV_INST(0), okay) */
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_DRV_INST(1), okay)
|
||||
DEVICE_DT_INST_DECLARE(1);
|
||||
|
||||
static void i2c_esp32_connect_irq_1(void)
|
||||
{
|
||||
IRQ_CONNECT(CONFIG_I2C_ESP32_1_IRQ, 1, i2c_esp32_isr,
|
||||
|
|
|
@ -607,8 +607,6 @@ static const struct i2c_driver_api i2c_sam_twim_driver_api = {
|
|||
.hs_data_strength_low = DT_INST_ENUM_IDX(n, hs_data_strength_low)
|
||||
|
||||
#define I2C_TWIM_SAM_INIT(n) \
|
||||
DEVICE_DT_INST_DECLARE(n); \
|
||||
\
|
||||
static void i2c##n##_sam_irq_config(void) \
|
||||
{ \
|
||||
IRQ_CONNECT(DT_INST_IRQN(n), DT_INST_IRQ(n, priority), \
|
||||
|
|
|
@ -339,8 +339,6 @@ static const struct i2c_driver_api i2c_sam_twi_driver_api = {
|
|||
};
|
||||
|
||||
#define I2C_TWI_SAM_INIT(n) \
|
||||
DEVICE_DT_INST_DECLARE(n); \
|
||||
\
|
||||
static void i2c##n##_sam_irq_config(void) \
|
||||
{ \
|
||||
IRQ_CONNECT(DT_INST_IRQN(n), DT_INST_IRQ(n, priority), \
|
||||
|
|
|
@ -326,8 +326,6 @@ static const struct i2c_driver_api i2c_sam_twihs_driver_api = {
|
|||
};
|
||||
|
||||
#define I2C_TWIHS_SAM_INIT(n) \
|
||||
DEVICE_DT_INST_DECLARE(n); \
|
||||
\
|
||||
static void i2c##n##_sam_irq_config(void) \
|
||||
{ \
|
||||
IRQ_CONNECT(DT_INST_IRQN(n), DT_INST_IRQ(n, priority), \
|
||||
|
|
|
@ -808,9 +808,6 @@ static const struct i2s_driver_api i2s_cavs_driver_api = {
|
|||
};
|
||||
|
||||
#define I2S_CAVS_DEVICE_INIT(n) \
|
||||
DEVICE_DT_INST_DECLARE(n); \
|
||||
static void i2s_cavs_irq_connect_##n(void); \
|
||||
\
|
||||
static const struct i2s_cavs_config i2s_cavs_config_##n = { \
|
||||
.regs = (struct i2s_cavs_ssp *) \
|
||||
DT_INST_REG_ADDR_BY_IDX(n, 0), \
|
||||
|
|
|
@ -898,8 +898,6 @@ static const struct device *get_dev_from_tx_dma_channel(uint32_t dma_channel)
|
|||
}
|
||||
|
||||
#define I2S_INIT(index, clk_sel) \
|
||||
DEVICE_DT_DECLARE(DT_NODELABEL(i2s##index)); \
|
||||
\
|
||||
static const struct soc_gpio_pinctrl i2s_pins_##index[] = \
|
||||
ST_STM32_DT_INST_PINCTRL(index, 0);\
|
||||
\
|
||||
|
|
|
@ -962,8 +962,6 @@ static const struct i2s_driver_api i2s_sam_driver_api = {
|
|||
|
||||
/* I2S0 */
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static const struct device *get_dev_from_dma_channel(uint32_t dma_channel)
|
||||
{
|
||||
return &DEVICE_DT_NAME_GET(DT_DRV_INST(0));
|
||||
|
|
|
@ -50,8 +50,6 @@ struct rv32m1_intmux_config {
|
|||
|
||||
#define DEV_REGS(dev) (DEV_CFG(dev)->regs)
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
/*
|
||||
* <irq_nextlevel.h> API
|
||||
*/
|
||||
|
|
|
@ -30,9 +30,6 @@ struct sam0_eic_data {
|
|||
#define DEV_DATA(dev) \
|
||||
((struct sam0_eic_data *const)(dev)->data)
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
|
||||
static void wait_synchronization(void)
|
||||
{
|
||||
#ifdef REG_EIC_SYNCBUSY
|
||||
|
|
|
@ -29,7 +29,6 @@ struct cavs_idc_data {
|
|||
void *user_data;
|
||||
};
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
static struct cavs_idc_data cavs_idc_device_data;
|
||||
|
||||
static void cavs_idc_isr(const struct device *dev)
|
||||
|
|
|
@ -27,8 +27,6 @@ static void gipm_send(uint32_t id);
|
|||
|
||||
#if IS_ENABLED(CONFIG_IPM_NRF_SINGLE_INSTANCE)
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static void nrfx_ipc_handler(uint32_t event_mask, void *p_context)
|
||||
{
|
||||
if (nrfx_ipm_data.callback) {
|
||||
|
|
|
@ -62,8 +62,6 @@ static KSCAN_Type *base = (KSCAN_Type *)
|
|||
|
||||
static struct kscan_xec_data kbd_data;
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static void drive_keyboard_column(int data)
|
||||
{
|
||||
if (data == KEYBOARD_COLUMN_DRIVE_ALL) {
|
||||
|
|
|
@ -299,8 +299,6 @@ static void iproc_pcie_flr(const struct device *dev)
|
|||
}
|
||||
#endif
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static void iproc_pcie_reset_config(const struct device *dev)
|
||||
{
|
||||
__unused uint32_t data;
|
||||
|
|
|
@ -108,8 +108,6 @@ static const struct sensor_driver_api temp_nrf5_driver_api = {
|
|||
.channel_get = temp_nrf5_channel_get,
|
||||
};
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static int temp_nrf5_init(const struct device *dev)
|
||||
{
|
||||
struct temp_nrf5_data *data = dev->data;
|
||||
|
|
|
@ -32,9 +32,6 @@ struct qdec_nrfx_data {
|
|||
|
||||
static struct qdec_nrfx_data qdec_nrfx_data;
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
|
||||
static void accumulate(struct qdec_nrfx_data *data, int16_t acc)
|
||||
{
|
||||
unsigned int key = irq_lock();
|
||||
|
|
|
@ -618,8 +618,6 @@ static const struct uart_driver_api uart_cc13xx_cc26xx_driver_api = {
|
|||
|
||||
|
||||
#define UART_CC13XX_CC26XX_INIT(n) \
|
||||
DEVICE_DT_INST_DECLARE(n); \
|
||||
\
|
||||
UART_CC13XX_CC26XX_INIT_FUNC(n); \
|
||||
\
|
||||
static const struct uart_device_config \
|
||||
|
|
|
@ -32,8 +32,6 @@ struct uart_cc32xx_dev_data_t {
|
|||
#define PRIME_CHAR '\r'
|
||||
|
||||
/* Forward decls: */
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
||||
static void uart_cc32xx_isr(const struct device *dev);
|
||||
#endif
|
||||
|
|
|
@ -33,8 +33,6 @@ struct uart_msp432p4xx_dev_data_t {
|
|||
#define DEV_DATA(dev) \
|
||||
((struct uart_msp432p4xx_dev_data_t * const)(dev)->data)
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
||||
static void uart_msp432p4xx_isr(const struct device *dev);
|
||||
#endif
|
||||
|
|
|
@ -52,8 +52,6 @@ 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);
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
/* Device data structure */
|
||||
struct uart_nrfx_data {
|
||||
struct uart_config uart_config;
|
||||
|
|
|
@ -1646,7 +1646,6 @@ static int uarte_nrfx_pm_control(const struct device *dev,
|
|||
|
||||
#define UART_NRF_UARTE_DEVICE(idx) \
|
||||
HWFC_CONFIG_CHECK(idx); \
|
||||
DEVICE_DT_DECLARE(UARTE(idx)); \
|
||||
UARTE_INT_DRIVEN(idx); \
|
||||
UARTE_ASYNC(idx); \
|
||||
static struct uarte_nrfx_data uarte_##idx##_data = { \
|
||||
|
|
|
@ -1173,8 +1173,6 @@ static const struct uart_driver_api uart_xlnx_ps_driver_api = {
|
|||
.irq_config_func = uart_xlnx_ps_irq_config_##port,
|
||||
|
||||
#define UART_XLNX_PS_IRQ_CONF_FUNC(port) \
|
||||
DEVICE_DT_INST_DECLARE(port); \
|
||||
\
|
||||
static void uart_xlnx_ps_irq_config_##port(const struct device *dev) \
|
||||
{ \
|
||||
IRQ_CONNECT(DT_INST_IRQN(port), \
|
||||
|
|
|
@ -225,7 +225,6 @@ static const struct wdt_driver_api wdt_api = {
|
|||
};
|
||||
|
||||
#define ESP32_WDT_INIT(idx) \
|
||||
DEVICE_DT_INST_DECLARE(idx); \
|
||||
static void wdt_esp32_connect_irq_func##idx(void) \
|
||||
{ \
|
||||
esp32_rom_intr_matrix_set(0, ETS_TG##idx##_WDT_LEVEL_INTR_SOURCE, \
|
||||
|
|
|
@ -24,9 +24,6 @@ struct wdt_xec_data {
|
|||
bool timeout_installed;
|
||||
};
|
||||
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static int wdt_xec_setup(const struct device *dev, uint8_t options)
|
||||
{
|
||||
WDT_Type *wdt_regs = WDT_XEC_REG_BASE;
|
||||
|
|
|
@ -153,7 +153,6 @@ static void wdt_event_handler(const struct device *dev)
|
|||
#define WDT(idx) DT_NODELABEL(wdt##idx)
|
||||
|
||||
#define WDT_NRFX_WDT_DEVICE(idx) \
|
||||
DEVICE_DT_DECLARE(WDT(idx)); \
|
||||
static void wdt_##idx##_event_handler(void) \
|
||||
{ \
|
||||
wdt_event_handler(DEVICE_DT_GET(WDT(idx))); \
|
||||
|
|
|
@ -34,8 +34,6 @@ struct wdt_sam_dev_cfg {
|
|||
Wdt *regs;
|
||||
};
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
struct wdt_sam_dev_data {
|
||||
wdt_callback_t cb;
|
||||
uint32_t mode;
|
||||
|
|
|
@ -38,8 +38,6 @@ struct wdt_sam0_dev_data {
|
|||
bool timeout_valid;
|
||||
};
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static struct wdt_sam0_dev_data wdt_sam0_data = { 0 };
|
||||
|
||||
static void wdt_sam0_wait_synchronization(void)
|
||||
|
|
|
@ -215,8 +215,6 @@ extern "C" {
|
|||
* @note A declaration for the corresponding device must be in scope;
|
||||
* e.g:
|
||||
*
|
||||
* @code DEVICE_DT_DECLARE(node_id); @endcode
|
||||
*
|
||||
* @param node_id The same as node_id provided to DEVICE_DT_DEFINE()
|
||||
*
|
||||
* @return A pointer to the device object created by DEVICE_DT_DEFINE()
|
||||
|
@ -232,42 +230,6 @@ extern "C" {
|
|||
*/
|
||||
#define DEVICE_DT_INST_GET(inst) DEVICE_DT_GET(DT_DRV_INST(inst))
|
||||
|
||||
/** @def DEVICE_DT_DECLARE
|
||||
*
|
||||
* @brief Declare a device object associated with @p node_id
|
||||
*
|
||||
* This macro can be used in source files to get a reference to the
|
||||
* device structure corresponding to a devicetree node.
|
||||
*
|
||||
* Within driver implementation files it is used to declare a device so
|
||||
* that DEVICE_DT_GET() may be used before the full declaration in
|
||||
* DEVICE_DT_DEFINE().
|
||||
*
|
||||
* This is often useful when configuring interrupts statically in a
|
||||
* device's init or per-instance config function, as the init function
|
||||
* itself is required by DEVICE_DT_DEFINE() and use of DEVICE_DT_GET()
|
||||
* inside it creates a circular dependency.
|
||||
*
|
||||
* It can also be used in unrelated modules to store the pointer to a
|
||||
* device without having to look it up at runtime through
|
||||
* device_get_binding().
|
||||
*
|
||||
* Note that the device declaration has no storage class specifiers.
|
||||
*
|
||||
* @param node_id The same as node_id provided to DEVICE_DT_DEFINE()
|
||||
*/
|
||||
#define DEVICE_DT_DECLARE(node_id) \
|
||||
extern const struct device DEVICE_DT_NAME_GET(node_id)
|
||||
|
||||
/** @def DEVICE_DT_INST_DECLARE
|
||||
*
|
||||
* @brief Declare a device object associated for an instance of a
|
||||
* DT_DRV_COMPAT compatible
|
||||
*
|
||||
* @param inst instance number
|
||||
*/
|
||||
#define DEVICE_DT_INST_DECLARE(inst) DEVICE_DT_DECLARE(DT_DRV_INST(inst))
|
||||
|
||||
/**
|
||||
* @def DEVICE_GET
|
||||
*
|
||||
|
@ -767,7 +729,7 @@ static inline int device_pm_put_sync(const struct device *dev) { return -ENOTSUP
|
|||
}
|
||||
#endif
|
||||
|
||||
/* device_extern is generated base on devicetree nodes */
|
||||
/* device_extern is generated based on devicetree nodes */
|
||||
#include <device_extern.h>
|
||||
|
||||
#include <syscalls/device.h>
|
||||
|
|
|
@ -41,8 +41,6 @@ struct sdhc_spi_data {
|
|||
#endif
|
||||
};
|
||||
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
/* Traces card traffic for LOG_LEVEL_DBG */
|
||||
static int sdhc_spi_trace(struct sdhc_spi_data *data, int dir, int err,
|
||||
const uint8_t *buf, int len)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue