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 <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2022-08-22 10:36:10 +02:00 committed by Carles Cufí
commit a202341958
215 changed files with 335 additions and 335 deletions

View file

@ -72,7 +72,7 @@ static int can_stm32fd_clock_enable(const struct device *dev)
int ret;
const struct can_mcan_config *mcan_cfg = dev->config;
const struct can_stm32fd_config *stm32fd_cfg = mcan_cfg->custom;
const struct device *clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
const struct device *const clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
LL_RCC_SetFDCANClockSource(CAN_STM32FD_CLOCK_SOURCE);

View file

@ -47,7 +47,7 @@ static int can_stm32h7_clock_enable(const struct device *dev)
{
const struct can_mcan_config *mcan_cfg = dev->config;
const struct can_stm32h7_config *stm32h7_cfg = mcan_cfg->custom;
const struct device *clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
const struct device *const clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
int ret;
LL_RCC_SetFDCANClockSource(LL_RCC_FDCAN_CLKSOURCE_PLL1Q);