Skip to content

Commit 02703e6

Browse files
committed
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 <[email protected]>
1 parent 98b6e4f commit 02703e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2
-160
lines changed

boards/arm/efr32mg_sltb004a/board.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ static int efr32mg_sltb004a_init(const struct device *dev)
3939
#define CCS811 DT_NODELABEL(ccs811)
4040

4141
#if DT_NODE_HAS_STATUS(CCS811, okay)
42-
DEVICE_DT_DECLARE(DT_GPIO_CTLR(CCS811, supply_gpios));
4342
cfg = (struct supply_cfg){
4443
.gpio = DEVICE_DT_GET(DT_GPIO_CTLR(CCS811, supply_gpios)),
4544
.pin = DT_GPIO_PIN(CCS811, supply_gpios),

boards/arm/frdm_k64f/pinmux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ static int frdm_k64f_pinmux_init(const struct device *dev)
1414

1515
#if DT_NODE_HAS_STATUS(DT_NODELABEL(porta), okay)
1616
__unused const struct device *porta =
17-
device_get_binding(DT_LABEL(DT_NODELABEL(porta)));
17+
DEVICE_DT_GET(DT_NODELABEL(porta));
1818
#endif
1919
#if DT_NODE_HAS_STATUS(DT_NODELABEL(portb), okay)
2020
__unused const struct device *portb =

drivers/adc/adc_mchp_xec.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ struct adc_xec_regs {
5151
#define ADC_XEC_REG_BASE \
5252
((struct adc_xec_regs *)(DT_INST_REG_ADDR(0)))
5353

54-
55-
DEVICE_DT_INST_DECLARE(0);
56-
5754
static void adc_context_start_sampling(struct adc_context *ctx)
5855
{
5956
struct adc_xec_data *data = CONTAINER_OF(ctx, struct adc_xec_data, ctx);

drivers/adc/adc_nrfx_adc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,6 @@ static int adc_nrfx_read_async(const struct device *dev,
239239
}
240240
#endif /* CONFIG_ADC_ASYNC */
241241

242-
DEVICE_DT_INST_DECLARE(0);
243-
244242
static void event_handler(const nrfx_adc_evt_t *p_event)
245243
{
246244
const struct device *dev = DEVICE_DT_INST_GET(0);

drivers/adc/adc_nrfx_saadc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,6 @@ static void saadc_irq_handler(const struct device *dev)
390390
}
391391
}
392392

393-
DEVICE_DT_INST_DECLARE(0);
394-
395393
static int init_saadc(const struct device *dev)
396394
{
397395
nrf_saadc_event_clear(NRF_SAADC, NRF_SAADC_EVENT_END);

drivers/clock_control/clock_control_nrf.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ static struct onoff_manager *get_onoff_manager(const struct device *dev,
110110
}
111111

112112

113-
DEVICE_DT_DECLARE(DT_NODELABEL(clock));
114-
115113
#define CLOCK_DEVICE DEVICE_DT_GET(DT_NODELABEL(clock))
116114

117115
struct onoff_manager *z_nrf_clock_control_get_onoff(clock_control_subsys_t sys)

drivers/counter/counter_gecko_rtcc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,6 @@ static const struct counter_driver_api counter_gecko_driver_api = {
332332

333333
/* RTCC0 */
334334

335-
DEVICE_DT_INST_DECLARE(0);
336-
337335
ISR_DIRECT_DECLARE(counter_gecko_isr_0)
338336
{
339337
const struct device *dev = DEVICE_DT_INST_GET(0);

drivers/counter/counter_nrfx_rtc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,6 @@ static const struct counter_driver_api counter_nrfx_driver_api = {
665665
BUILD_ASSERT((RTC_PROP(idx, prescaler) - 1) <= \
666666
RTC_PRESCALER_PRESCALER_Msk, \
667667
"RTC prescaler out of range"); \
668-
DEVICE_DT_DECLARE(RTC(idx)); \
669668
static int counter_##idx##_init(const struct device *dev) \
670669
{ \
671670
IRQ_CONNECT(DT_IRQN(RTC(idx)), DT_IRQ(RTC(idx), priority), \

drivers/counter/counter_nrfx_timer.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,6 @@ static const struct counter_driver_api counter_nrfx_driver_api = {
397397
BUILD_ASSERT(TIMER_PROP(idx, prescaler) <= \
398398
TIMER_PRESCALER_PRESCALER_Msk, \
399399
"TIMER prescaler out of range"); \
400-
DEVICE_DT_DECLARE(TIMER(idx)); \
401400
static int counter_##idx##_init(const struct device *dev) \
402401
{ \
403402
IRQ_CONNECT(DT_IRQN(TIMER(idx)), DT_IRQ(TIMER(idx), priority), \

drivers/dma/dma_dw.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,6 @@ static const struct dma_driver_api dw_dma_driver_api = {
362362

363363
#define DW_DMAC_INIT(inst) \
364364
\
365-
DEVICE_DT_INST_DECLARE(inst); \
366-
\
367365
static struct dw_drv_plat_data dmac##inst = { \
368366
.chan[0] = { \
369367
.class = 6, \

0 commit comments

Comments
 (0)