devices: constify statically initialized device pointers
It is frequent to find variable definitions like this: ```c static const struct device *dev = DEVICE_DT_GET(...) ``` That is, module level variables that are statically initialized with a device reference. Such value is, in most cases, never changed meaning the variable can also be declared as const (immutable). This patch constifies all such cases. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
42b53e46aa
commit
e0125d04af
48 changed files with 56 additions and 53 deletions
|
@ -97,7 +97,7 @@ static void gpio_xlnx_ps_isr(const struct device *dev)
|
|||
#define GPIO_XLNX_PS_CHILD_CONCAT(idx) DEVICE_DT_GET(idx),
|
||||
|
||||
#define GPIO_XLNX_PS_GEN_BANK_ARRAY(idx)\
|
||||
static const struct device *gpio_xlnx_ps##idx##_banks[] = {\
|
||||
static const struct device *const gpio_xlnx_ps##idx##_banks[] = {\
|
||||
DT_FOREACH_CHILD_STATUS_OKAY(DT_DRV_INST(idx), GPIO_XLNX_PS_CHILD_CONCAT)\
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue