Skip to content

Commit a202341

Browse files
gmarullcarlescufi
authored andcommitted
devices: constify device pointers initialized at compile time
Many device pointers are initialized at compile and never changed. This means that the device pointer can be constified (immutable). Automated using: ``` perl -i -pe 's/const struct device \*(?!const)(.*)= DEVICE/const struct device *const $1= DEVICE/g' **/*.c ``` Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent aa0a7df commit a202341

File tree

215 files changed

+335
-335
lines changed

Some content is hidden

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

215 files changed

+335
-335
lines changed

boards/arm/mec1501modular_assy6885/pinmux.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -130,42 +130,42 @@ static int board_pinmux_init(const struct device *dev)
130130
struct pinmux_ports_t pinmux_ports;
131131

132132
#if DT_NODE_HAS_STATUS(DT_NODELABEL(pinmux_000_036), okay)
133-
const struct device *porta = DEVICE_DT_GET(DT_NODELABEL(pinmux_000_036));
133+
const struct device *const porta = DEVICE_DT_GET(DT_NODELABEL(pinmux_000_036));
134134

135135
__ASSERT_NO_MSG(device_is_ready(porta));
136136

137137
pinmux_ports.porta = porta;
138138
#endif
139139
#if DT_NODE_HAS_STATUS(DT_NODELABEL(pinmux_040_076), okay)
140-
const struct device *portb = DEVICE_DT_GET(DT_NODELABEL(pinmux_040_076));
140+
const struct device *const portb = DEVICE_DT_GET(DT_NODELABEL(pinmux_040_076));
141141

142142
__ASSERT_NO_MSG(device_is_ready(portb));
143143

144144
pinmux_ports.portb = portb;
145145
#endif
146146
#if DT_NODE_HAS_STATUS(DT_NODELABEL(pinmux_100_136), okay)
147-
const struct device *portc = DEVICE_DT_GET(DT_NODELABEL(pinmux_100_136));
147+
const struct device *const portc = DEVICE_DT_GET(DT_NODELABEL(pinmux_100_136));
148148

149149
__ASSERT_NO_MSG(device_is_ready(portc));
150150

151151
pinmux_ports.portc = portc;
152152
#endif
153153
#if DT_NODE_HAS_STATUS(DT_NODELABEL(pinmux_140_176), okay)
154-
const struct device *portd = DEVICE_DT_GET(DT_NODELABEL(pinmux_140_176));
154+
const struct device *const portd = DEVICE_DT_GET(DT_NODELABEL(pinmux_140_176));
155155

156156
__ASSERT_NO_MSG(device_is_ready(portd));
157157

158158
pinmux_ports.portd = portd;
159159
#endif
160160
#if DT_NODE_HAS_STATUS(DT_NODELABEL(pinmux_200_236), okay)
161-
const struct device *porte = DEVICE_DT_GET(DT_NODELABEL(pinmux_200_236));
161+
const struct device *const porte = DEVICE_DT_GET(DT_NODELABEL(pinmux_200_236));
162162

163163
__ASSERT_NO_MSG(device_is_ready(porte));
164164

165165
pinmux_ports.porte = porte;
166166
#endif
167167
#if DT_NODE_HAS_STATUS(DT_NODELABEL(pinmux_240_276), okay)
168-
const struct device *portf = DEVICE_DT_GET(DT_NODELABEL(pinmux_240_276));
168+
const struct device *const portf = DEVICE_DT_GET(DT_NODELABEL(pinmux_240_276));
169169

170170
__ASSERT_NO_MSG(device_is_ready(portf));
171171

boards/arm/mec15xxevb_assy6853/pinmux.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -132,42 +132,42 @@ static int board_pinmux_init(const struct device *dev)
132132
struct pinmux_ports_t pinmux_ports;
133133

134134
#if DT_NODE_HAS_STATUS(DT_NODELABEL(pinmux_000_036), okay)
135-
const struct device *porta = DEVICE_DT_GET(DT_NODELABEL(pinmux_000_036));
135+
const struct device *const porta = DEVICE_DT_GET(DT_NODELABEL(pinmux_000_036));
136136

137137
__ASSERT_NO_MSG(device_is_ready(porta));
138138

139139
pinmux_ports.porta = porta;
140140
#endif
141141
#if DT_NODE_HAS_STATUS(DT_NODELABEL(pinmux_040_076), okay)
142-
const struct device *portb = DEVICE_DT_GET(DT_NODELABEL(pinmux_040_076));
142+
const struct device *const portb = DEVICE_DT_GET(DT_NODELABEL(pinmux_040_076));
143143

144144
__ASSERT_NO_MSG(device_is_ready(portb));
145145

146146
pinmux_ports.portb = portb;
147147
#endif
148148
#if DT_NODE_HAS_STATUS(DT_NODELABEL(pinmux_100_136), okay)
149-
const struct device *portc = DEVICE_DT_GET(DT_NODELABEL(pinmux_100_136));
149+
const struct device *const portc = DEVICE_DT_GET(DT_NODELABEL(pinmux_100_136));
150150

151151
__ASSERT_NO_MSG(device_is_ready(portc));
152152

153153
pinmux_ports.portc = portc;
154154
#endif
155155
#if DT_NODE_HAS_STATUS(DT_NODELABEL(pinmux_140_176), okay)
156-
const struct device *portd = DEVICE_DT_GET(DT_NODELABEL(pinmux_140_176));
156+
const struct device *const portd = DEVICE_DT_GET(DT_NODELABEL(pinmux_140_176));
157157

158158
__ASSERT_NO_MSG(device_is_ready(portd));
159159

160160
pinmux_ports.portd = portd;
161161
#endif
162162
#if DT_NODE_HAS_STATUS(DT_NODELABEL(pinmux_200_236), okay)
163-
const struct device *porte = DEVICE_DT_GET(DT_NODELABEL(pinmux_200_236));
163+
const struct device *const porte = DEVICE_DT_GET(DT_NODELABEL(pinmux_200_236));
164164

165165
__ASSERT_NO_MSG(device_is_ready(porte));
166166

167167
pinmux_ports.porte = porte;
168168
#endif
169169
#if DT_NODE_HAS_STATUS(DT_NODELABEL(pinmux_240_276), okay)
170-
const struct device *portf = DEVICE_DT_GET(DT_NODELABEL(pinmux_240_276));
170+
const struct device *const portf = DEVICE_DT_GET(DT_NODELABEL(pinmux_240_276));
171171

172172
__ASSERT_NO_MSG(device_is_ready(portf));
173173

boards/arm/nrf9160dk_nrf9160/nrf52840_reset.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ int bt_hci_transport_setup(const struct device *h4)
2121
{
2222
int err;
2323
char c;
24-
const struct device *port = DEVICE_DT_GET(RESET_GPIO_CTRL);
24+
const struct device *const port = DEVICE_DT_GET(RESET_GPIO_CTRL);
2525

2626
if (!device_is_ready(port)) {
2727
return -EIO;

boards/arm/sparkfun_thing_plus_nrf9160/board.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ static int board_sparkfun_thing_plus_nrf9160_init(const struct device *dev)
1515
ARG_UNUSED(dev);
1616

1717
/* Get handle of the GPIO device. */
18-
const struct device *gpio = DEVICE_DT_GET(GPIO0);
18+
const struct device *const gpio = DEVICE_DT_GET(GPIO0);
1919

2020
if (!device_is_ready(gpio)) {
2121
return -ENODEV;

boards/riscv/rv32m1_vega/board.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
static int rv32m1_vega_board_init(const struct device *dev)
1212
{
13-
const struct device *gpiob = DEVICE_DT_GET(DT_NODELABEL(gpiob));
14-
const struct device *gpioc = DEVICE_DT_GET(DT_NODELABEL(gpioc));
15-
const struct device *gpiod = DEVICE_DT_GET(DT_NODELABEL(gpiod));
13+
const struct device *const gpiob = DEVICE_DT_GET(DT_NODELABEL(gpiob));
14+
const struct device *const gpioc = DEVICE_DT_GET(DT_NODELABEL(gpioc));
15+
const struct device *const gpiod = DEVICE_DT_GET(DT_NODELABEL(gpiod));
1616

1717
ARG_UNUSED(dev);
1818

doc/build/dts/howtos.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ device is to use :c:func:`DEVICE_DT_GET`:
104104

105105
.. code-block:: c
106106
107-
const struct device *uart_dev = DEVICE_DT_GET(MY_SERIAL);
107+
const struct device *const uart_dev = DEVICE_DT_GET(MY_SERIAL);
108108
109109
if (!device_is_ready(uart_dev)) {
110110
/* Not ready, do not use */
@@ -142,7 +142,7 @@ that the node has ``status = "okay"``, like this:
142142
#define MY_SERIAL DT_NODELABEL(my_serial)
143143
144144
#if DT_NODE_HAS_STATUS(MY_SERIAL, okay)
145-
const struct device *uart_dev = DEVICE_DT_GET(MY_SERIAL);
145+
const struct device *const uart_dev = DEVICE_DT_GET(MY_SERIAL);
146146
#else
147147
#error "Node is disabled"
148148
#endif

doc/hardware/peripherals/canbus/controller.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ a mailbox. When a transmitting mailbox is assigned, sending cannot be canceled.
158158
.dlc = 8,
159159
.data = {1,2,3,4,5,6,7,8}
160160
};
161-
const struct device *can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus));
161+
const struct device *const can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus));
162162
int ret;
163163
164164
ret = can_send(can_dev, &frame, K_MSEC(100), NULL, NULL);
@@ -234,7 +234,7 @@ The filter for this example is configured to match the identifier 0x123 exactly.
234234
.id_mask = CAN_STD_ID_MASK
235235
};
236236
int filter_id;
237-
const struct device *can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus));
237+
const struct device *const can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus));
238238
239239
filter_id = can_add_rx_filter(can_dev, rx_callback_function, callback_arg, &my_filter);
240240
if (filter_id < 0) {
@@ -261,7 +261,7 @@ The filter for this example is configured to match the extended identifier
261261
CAN_MSGQ_DEFINE(my_can_msgq, 2);
262262
struct can_frame rx_frame;
263263
int filter_id;
264-
const struct device *can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus));
264+
const struct device *const can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus));
265265
266266
filter_id = can_add_rx_filter_msgq(can_dev, &my_can_msgq, &my_filter);
267267
if (filter_id < 0) {
@@ -292,7 +292,7 @@ The following example sets the bitrate to 250k baud with the sampling point at
292292
.. code-block:: C
293293
294294
struct can_timing timing;
295-
const struct device *can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus));
295+
const struct device *const can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus));
296296
int ret;
297297
298298
ret = can_calc_timing(can_dev, &timing, 250000, 875);

doc/services/usb/uds_cdc_acm.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ the DTR signal:
7272

7373
.. code-block:: c
7474
75-
const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console));
75+
const struct device *const dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console));
7676
uint32_t dtr = 0;
7777
7878
if (usb_enable(NULL)) {

drivers/adc/adc_ite_it8xxx2.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static void adc_it8xxx2_get_sample(const struct device *dev)
176176

177177
static void adc_poll_valid_data(void)
178178
{
179-
const struct device *dev = DEVICE_DT_INST_GET(0);
179+
const struct device *const dev = DEVICE_DT_INST_GET(0);
180180
int valid = 0;
181181

182182
/*
@@ -205,7 +205,7 @@ static void adc_poll_valid_data(void)
205205
static void adc_enable_measurement(uint32_t ch)
206206
{
207207
struct adc_it8xxx2_regs *const adc_regs = ADC_IT8XXX2_REG_BASE;
208-
const struct device *dev = DEVICE_DT_INST_GET(0);
208+
const struct device *const dev = DEVICE_DT_INST_GET(0);
209209
struct adc_it8xxx2_data *data = dev->data;
210210

211211
if (ch <= CHIP_ADC_CH7) {

drivers/adc/adc_nrfx_adc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ static int adc_nrfx_read_async(const struct device *dev,
253253

254254
static void event_handler(const nrfx_adc_evt_t *p_event)
255255
{
256-
const struct device *dev = DEVICE_DT_INST_GET(0);
256+
const struct device *const dev = DEVICE_DT_INST_GET(0);
257257

258258
if (p_event->type == NRFX_ADC_EVT_DONE) {
259259
adc_context_on_sampling_done(&m_data.ctx, dev);

drivers/adc/adc_stm32.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ static int adc_stm32_init(const struct device *dev)
978978
{
979979
struct adc_stm32_data *data = dev->data;
980980
const struct adc_stm32_cfg *config = dev->config;
981-
const struct device *clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
981+
const struct device *const clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
982982
ADC_TypeDef *adc = (ADC_TypeDef *)config->base;
983983
int err;
984984

drivers/cache/cache_aspeed.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
static void aspeed_cache_init(void)
5151
{
52-
const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
52+
const struct device *const dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
5353
uint32_t start_bit, end_bit, max_bit;
5454

5555
/* set all cache areas to no-cache by default */
@@ -112,7 +112,7 @@ void cache_data_enable(void)
112112

113113
void cache_data_disable(void)
114114
{
115-
const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
115+
const struct device *const dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
116116

117117
syscon_write_reg(dev, CACHE_FUNC_CTRL_REG, 0);
118118
}
@@ -124,14 +124,14 @@ void cache_instr_enable(void)
124124

125125
void cache_instr_disable(void)
126126
{
127-
const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
127+
const struct device *const dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
128128

129129
syscon_write_reg(dev, CACHE_FUNC_CTRL_REG, 0);
130130
}
131131

132132
int cache_data_all(int op)
133133
{
134-
const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
134+
const struct device *const dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
135135
uint32_t ctrl;
136136
unsigned int key = 0;
137137

@@ -162,7 +162,7 @@ int cache_data_all(int op)
162162
int cache_data_range(void *addr, size_t size, int op)
163163
{
164164
uint32_t aligned_addr, i, n;
165-
const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
165+
const struct device *const dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
166166
unsigned int key = 0;
167167

168168
ARG_UNUSED(op);
@@ -196,7 +196,7 @@ int cache_data_range(void *addr, size_t size, int op)
196196

197197
int cache_instr_all(int op)
198198
{
199-
const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
199+
const struct device *const dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
200200
uint32_t ctrl;
201201
unsigned int key = 0;
202202

@@ -227,7 +227,7 @@ int cache_instr_all(int op)
227227
int cache_instr_range(void *addr, size_t size, int op)
228228
{
229229
uint32_t aligned_addr, i, n;
230-
const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
230+
const struct device *const dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
231231
unsigned int key = 0;
232232

233233
ARG_UNUSED(op);
@@ -262,7 +262,7 @@ int cache_instr_range(void *addr, size_t size, int op)
262262
#ifdef CONFIG_DCACHE_LINE_SIZE_DETECT
263263
size_t cache_data_line_size_get(void)
264264
{
265-
const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
265+
const struct device *const dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
266266
uint32_t ctrl;
267267

268268
syscon_read_reg(dev, CACHE_FUNC_CTRL_REG, &ctrl);
@@ -274,7 +274,7 @@ size_t cache_data_line_size_get(void)
274274
#ifdef CONFIG_ICACHE_LINE_SIZE_DETECT
275275
size_t cache_instr_line_size_get(void)
276276
{
277-
const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
277+
const struct device *const dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
278278
uint32_t ctrl;
279279

280280
syscon_read_reg(dev, CACHE_FUNC_CTRL_REG, &ctrl);

drivers/can/can_stm32fd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static int can_stm32fd_clock_enable(const struct device *dev)
7272
int ret;
7373
const struct can_mcan_config *mcan_cfg = dev->config;
7474
const struct can_stm32fd_config *stm32fd_cfg = mcan_cfg->custom;
75-
const struct device *clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
75+
const struct device *const clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
7676

7777
LL_RCC_SetFDCANClockSource(CAN_STM32FD_CLOCK_SOURCE);
7878

drivers/can/can_stm32h7.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static int can_stm32h7_clock_enable(const struct device *dev)
4747
{
4848
const struct can_mcan_config *mcan_cfg = dev->config;
4949
const struct can_stm32h7_config *stm32h7_cfg = mcan_cfg->custom;
50-
const struct device *clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
50+
const struct device *const clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
5151
int ret;
5252

5353
LL_RCC_SetFDCANClockSource(LL_RCC_FDCAN_CLKSOURCE_PLL1Q);

drivers/counter/counter_gecko_rtcc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ static const struct counter_driver_api counter_gecko_driver_api = {
320320

321321
ISR_DIRECT_DECLARE(counter_gecko_isr_0)
322322
{
323-
const struct device *dev = DEVICE_DT_INST_GET(0);
323+
const struct device *const dev = DEVICE_DT_INST_GET(0);
324324
struct counter_gecko_data *const dev_data = dev->data;
325325
counter_alarm_callback_t alarm_callback;
326326
uint32_t count = RTCC_CounterGet();

drivers/counter/counter_ll_stm32_rtc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ void rtc_stm32_isr(const struct device *dev)
278278

279279
static int rtc_stm32_init(const struct device *dev)
280280
{
281-
const struct device *clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
281+
const struct device *const clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
282282
const struct rtc_stm32_config *cfg = dev->config;
283283
struct rtc_stm32_data *data = dev->data;
284284

drivers/counter/timer_dtmr_cmsdk_apb.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static int dtmr_cmsdk_apb_init(const struct device *dev)
144144

145145
#ifdef CONFIG_CLOCK_CONTROL
146146
/* Enable clock for subsystem */
147-
const struct device *clk = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR(0));
147+
const struct device *const clk = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR(0));
148148

149149
if (!device_is_ready(clk)) {
150150
return -ENODEV;

drivers/counter/timer_tmr_cmsdk_apb.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static int tmr_cmsdk_apb_init(const struct device *dev)
147147

148148
#ifdef CONFIG_CLOCK_CONTROL
149149
/* Enable clock for subsystem */
150-
const struct device *clk = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR(0));
150+
const struct device *const clk = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR(0));
151151

152152
if (!device_is_ready(clk)) {
153153
return -ENODEV;

drivers/crypto/crypto_stm32.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ static int crypto_stm32_query_caps(const struct device *dev)
449449

450450
static int crypto_stm32_init(const struct device *dev)
451451
{
452-
const struct device *clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
452+
const struct device *const clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
453453
struct crypto_stm32_data *data = CRYPTO_STM32_DATA(dev);
454454
const struct crypto_stm32_config *cfg = CRYPTO_STM32_CFG(dev);
455455

drivers/dac/dac_stm32.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static int dac_stm32_init(const struct device *dev)
119119
int err;
120120

121121
/* enable clock for subsystem */
122-
const struct device *clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
122+
const struct device *const clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
123123

124124
if (!device_is_ready(clk)) {
125125
LOG_ERR("clock control device not ready");

drivers/disk/sdmmc_stm32.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ static int stm32_sdmmc_pwr_uninit(struct stm32_sdmmc_priv *priv)
556556
static int disk_stm32_sdmmc_init(const struct device *dev)
557557
{
558558
struct stm32_sdmmc_priv *priv = dev->data;
559-
const struct device *clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
559+
const struct device *const clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
560560
int err;
561561

562562
if (!device_is_ready(clk)) {

drivers/dma/dma_stm32.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ DMA_STM32_EXPORT_API int dma_stm32_stop(const struct device *dev, uint32_t id)
615615
static int dma_stm32_init(const struct device *dev)
616616
{
617617
const struct dma_stm32_config *config = dev->config;
618-
const struct device *clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
618+
const struct device *const clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
619619

620620
if (!device_is_ready(clk)) {
621621
LOG_ERR("clock control device not ready");

0 commit comments

Comments
 (0)