Browse Source

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>
pull/31355/head
Kumar Gala 5 years ago committed by Kumar Gala
parent
commit
02703e60d9
  1. 1
      boards/arm/efr32mg_sltb004a/board.c
  2. 2
      boards/arm/frdm_k64f/pinmux.c
  3. 3
      drivers/adc/adc_mchp_xec.c
  4. 2
      drivers/adc/adc_nrfx_adc.c
  5. 2
      drivers/adc/adc_nrfx_saadc.c
  6. 2
      drivers/clock_control/clock_control_nrf.c
  7. 2
      drivers/counter/counter_gecko_rtcc.c
  8. 1
      drivers/counter/counter_nrfx_rtc.c
  9. 1
      drivers/counter/counter_nrfx_timer.c
  10. 2
      drivers/dma/dma_dw.c
  11. 2
      drivers/dma/dma_pl330.c
  12. 2
      drivers/dma/dma_sam0.c
  13. 2
      drivers/dma/dma_sam_xdmac.c
  14. 4
      drivers/dma/dma_stm32.c
  15. 2
      drivers/entropy/entropy_cc13xx_cc26xx.c
  16. 2
      drivers/ethernet/eth_e1000.c
  17. 2
      drivers/ethernet/eth_gecko.c
  18. 2
      drivers/ethernet/eth_sam_gmac.c
  19. 2
      drivers/ethernet/eth_smsc911x.c
  20. 2
      drivers/ethernet/eth_stellaris.c
  21. 2
      drivers/ethernet/eth_stm32_hal.c
  22. 2
      drivers/gpio/gpio_cc13xx_cc26xx.c
  23. 1
      drivers/gpio/gpio_cc32xx.c
  24. 2
      drivers/gpio/gpio_esp32.c
  25. 10
      drivers/gpio/gpio_lpc11u6x.c
  26. 7
      drivers/gpio/gpio_nrfx.c
  27. 2
      drivers/i2c/i2c_cc13xx_cc26xx.c
  28. 4
      drivers/i2c/i2c_esp32.c
  29. 2
      drivers/i2c/i2c_sam4l_twim.c
  30. 2
      drivers/i2c/i2c_sam_twi.c
  31. 2
      drivers/i2c/i2c_sam_twihs.c
  32. 3
      drivers/i2s/i2s_cavs.c
  33. 2
      drivers/i2s/i2s_ll_stm32.c
  34. 2
      drivers/i2s/i2s_sam_ssc.c
  35. 2
      drivers/interrupt_controller/intc_rv32m1_intmux.c
  36. 3
      drivers/interrupt_controller/intc_sam0_eic.c
  37. 1
      drivers/ipm/ipm_cavs_idc.c
  38. 2
      drivers/ipm/ipm_nrfx_ipc.c
  39. 2
      drivers/kscan/kscan_mchp_xec.c
  40. 2
      drivers/pcie/endpoint/pcie_ep_iproc.c
  41. 2
      drivers/sensor/nrf5/temp_nrf5.c
  42. 3
      drivers/sensor/qdec_nrfx/qdec_nrfx.c
  43. 2
      drivers/serial/uart_cc13xx_cc26xx.c
  44. 2
      drivers/serial/uart_cc32xx.c
  45. 2
      drivers/serial/uart_msp432p4xx.c
  46. 2
      drivers/serial/uart_nrfx_uart.c
  47. 1
      drivers/serial/uart_nrfx_uarte.c
  48. 2
      drivers/serial/uart_xlnx_ps.c
  49. 1
      drivers/watchdog/wdt_esp32.c
  50. 3
      drivers/watchdog/wdt_mchp_xec.c
  51. 1
      drivers/watchdog/wdt_nrfx.c
  52. 2
      drivers/watchdog/wdt_sam.c
  53. 2
      drivers/watchdog/wdt_sam0.c
  54. 40
      include/device.h
  55. 2
      subsys/disk/disk_access_spi_sdhc.c

1
boards/arm/efr32mg_sltb004a/board.c

@ -39,7 +39,6 @@ static int efr32mg_sltb004a_init(const struct device *dev) @@ -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),

2
boards/arm/frdm_k64f/pinmux.c

@ -14,7 +14,7 @@ static int frdm_k64f_pinmux_init(const struct device *dev) @@ -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 =

3
drivers/adc/adc_mchp_xec.c

@ -51,9 +51,6 @@ struct adc_xec_regs { @@ -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);

2
drivers/adc/adc_nrfx_adc.c

@ -239,8 +239,6 @@ static int adc_nrfx_read_async(const struct device *dev, @@ -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);

2
drivers/adc/adc_nrfx_saadc.c

@ -390,8 +390,6 @@ static void saadc_irq_handler(const struct device *dev) @@ -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);

2
drivers/clock_control/clock_control_nrf.c

@ -110,8 +110,6 @@ static struct onoff_manager *get_onoff_manager(const struct device *dev, @@ -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)

2
drivers/counter/counter_gecko_rtcc.c

@ -332,8 +332,6 @@ static const struct counter_driver_api counter_gecko_driver_api = { @@ -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);

1
drivers/counter/counter_nrfx_rtc.c

@ -665,7 +665,6 @@ static const struct counter_driver_api counter_nrfx_driver_api = { @@ -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), \

1
drivers/counter/counter_nrfx_timer.c

@ -397,7 +397,6 @@ static const struct counter_driver_api counter_nrfx_driver_api = { @@ -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), \

2
drivers/dma/dma_dw.c

@ -362,8 +362,6 @@ static const struct dma_driver_api dw_dma_driver_api = { @@ -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, \

2
drivers/dma/dma_pl330.c

@ -582,8 +582,6 @@ static const struct dma_driver_api pl330_driver_api = { @@ -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

2
drivers/dma/dma_sam0.c

@ -396,8 +396,6 @@ static int dma_sam0_get_status(const struct device *dev, uint32_t channel, @@ -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), \

2
drivers/dma/dma_sam_xdmac.c

@ -347,8 +347,6 @@ static const struct dma_driver_api sam_xdmac_driver_api = { @@ -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,

4
drivers/dma/dma_stm32.c

@ -683,8 +683,6 @@ static void dma_stm32_irq_##dma##_##chan(const struct device *dev) \ @@ -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); @@ -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);

2
drivers/entropy/entropy_cc13xx_cc26xx.c

@ -40,8 +40,6 @@ struct entropy_cc13xx_cc26xx_data { @@ -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)
{

2
drivers/ethernet/eth_e1000.c

@ -210,8 +210,6 @@ static void e1000_isr(const struct device *device) @@ -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);

2
drivers/ethernet/eth_gecko.c

@ -636,8 +636,6 @@ static const struct ethernet_api eth_api = { @@ -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),

2
drivers/ethernet/eth_sam_gmac.c

@ -2139,8 +2139,6 @@ static const struct ethernet_api eth_api = { @@ -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),

2
drivers/ethernet/eth_smsc911x.c

@ -658,8 +658,6 @@ done: @@ -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),

2
drivers/ethernet/eth_stellaris.c

@ -318,8 +318,6 @@ static int eth_stellaris_dev_init(const struct device *dev) @@ -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. */

2
drivers/ethernet/eth_stm32_hal.c

@ -855,8 +855,6 @@ static const struct ethernet_api eth_api = { @@ -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,

2
drivers/gpio/gpio_cc13xx_cc26xx.c

@ -217,8 +217,6 @@ static uint32_t gpio_cc13xx_cc26xx_get_pending_int(const struct device *dev) @@ -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;

1
drivers/gpio/gpio_cc32xx.c

@ -275,7 +275,6 @@ static const struct gpio_driver_api api_funcs = { @@ -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) \

2
drivers/gpio/gpio_esp32.c

@ -265,8 +265,6 @@ static void gpio_esp32_fire_callbacks(const struct device *device) @@ -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;

10
drivers/gpio/gpio_lpc11u6x.c

@ -418,16 +418,6 @@ static uint32_t gpio_lpc11u6x_get_pending_int(const struct device *dev) @@ -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 =

7
drivers/gpio/gpio_nrfx.c

@ -396,13 +396,6 @@ static inline void fire_callbacks(const struct device *port, uint32_t pins) @@ -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};

2
drivers/i2c/i2c_cc13xx_cc26xx.c

@ -23,8 +23,6 @@ LOG_MODULE_REGISTER(i2c_cc13xx_cc26xx); @@ -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;

4
drivers/i2c/i2c_esp32.c

@ -579,8 +579,6 @@ static const struct i2c_driver_api i2c_esp32_driver_api = { @@ -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, @@ -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,

2
drivers/i2c/i2c_sam4l_twim.c

@ -607,8 +607,6 @@ static const struct i2c_driver_api i2c_sam_twim_driver_api = { @@ -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), \

2
drivers/i2c/i2c_sam_twi.c

@ -339,8 +339,6 @@ static const struct i2c_driver_api i2c_sam_twi_driver_api = { @@ -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), \

2
drivers/i2c/i2c_sam_twihs.c

@ -326,8 +326,6 @@ static const struct i2c_driver_api i2c_sam_twihs_driver_api = { @@ -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), \

3
drivers/i2s/i2s_cavs.c

@ -808,9 +808,6 @@ static const struct i2s_driver_api i2s_cavs_driver_api = { @@ -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), \

2
drivers/i2s/i2s_ll_stm32.c

@ -898,8 +898,6 @@ static const struct device *get_dev_from_tx_dma_channel(uint32_t dma_channel) @@ -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);\
\

2
drivers/i2s/i2s_sam_ssc.c

@ -962,8 +962,6 @@ static const struct i2s_driver_api i2s_sam_driver_api = { @@ -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));

2
drivers/interrupt_controller/intc_rv32m1_intmux.c

@ -50,8 +50,6 @@ struct rv32m1_intmux_config { @@ -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
*/

3
drivers/interrupt_controller/intc_sam0_eic.c

@ -30,9 +30,6 @@ struct sam0_eic_data { @@ -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

1
drivers/ipm/ipm_cavs_idc.c

@ -29,7 +29,6 @@ struct cavs_idc_data { @@ -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)

2
drivers/ipm/ipm_nrfx_ipc.c

@ -27,8 +27,6 @@ static void gipm_send(uint32_t id); @@ -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) {

2
drivers/kscan/kscan_mchp_xec.c

@ -62,8 +62,6 @@ static KSCAN_Type *base = (KSCAN_Type *) @@ -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) {

2
drivers/pcie/endpoint/pcie_ep_iproc.c

@ -299,8 +299,6 @@ static void iproc_pcie_flr(const struct device *dev) @@ -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;

2
drivers/sensor/nrf5/temp_nrf5.c

@ -108,8 +108,6 @@ static const struct sensor_driver_api temp_nrf5_driver_api = { @@ -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;

3
drivers/sensor/qdec_nrfx/qdec_nrfx.c

@ -32,9 +32,6 @@ struct qdec_nrfx_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();

2
drivers/serial/uart_cc13xx_cc26xx.c

@ -618,8 +618,6 @@ static const struct uart_driver_api uart_cc13xx_cc26xx_driver_api = { @@ -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 \

2
drivers/serial/uart_cc32xx.c

@ -32,8 +32,6 @@ struct uart_cc32xx_dev_data_t { @@ -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

2
drivers/serial/uart_msp432p4xx.c

@ -33,8 +33,6 @@ struct uart_msp432p4xx_dev_data_t { @@ -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

2
drivers/serial/uart_nrfx_uart.c

@ -52,8 +52,6 @@ BUILD_ASSERT((PROP(hw_flow_control) && HW_FLOW_CONTROL_AVAILABLE) || @@ -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;

1
drivers/serial/uart_nrfx_uarte.c

@ -1646,7 +1646,6 @@ static int uarte_nrfx_pm_control(const struct device *dev, @@ -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 = { \

2
drivers/serial/uart_xlnx_ps.c

@ -1173,8 +1173,6 @@ static const struct uart_driver_api uart_xlnx_ps_driver_api = { @@ -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), \

1
drivers/watchdog/wdt_esp32.c

@ -225,7 +225,6 @@ static const struct wdt_driver_api wdt_api = { @@ -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, \

3
drivers/watchdog/wdt_mchp_xec.c

@ -24,9 +24,6 @@ struct wdt_xec_data { @@ -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;

1
drivers/watchdog/wdt_nrfx.c

@ -153,7 +153,6 @@ static void wdt_event_handler(const struct device *dev) @@ -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))); \

2
drivers/watchdog/wdt_sam.c

@ -34,8 +34,6 @@ struct wdt_sam_dev_cfg { @@ -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;

2
drivers/watchdog/wdt_sam0.c

@ -38,8 +38,6 @@ struct wdt_sam0_dev_data { @@ -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)

40
include/device.h

@ -215,8 +215,6 @@ extern "C" { @@ -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" { @@ -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 @@ -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>

2
subsys/disk/disk_access_spi_sdhc.c

@ -41,8 +41,6 @@ struct sdhc_spi_data { @@ -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…
Cancel
Save