Skip to content
Commit 3a2921da authored by Gerard Marull-Paretas's avatar Gerard Marull-Paretas Committed by Carles Cufí
Browse files

device: make all struct device members mutable



All `struct device` members except name, config and api are marked as
read-only references. This means that, in practice, a `struct device`
can only be initialized statically.

Device constness happens because `Z_DEVICE_DEFINE` defines `struct
device` as `const`. This means that one can't modify any field of a
`struct device` anyway, so constifying struct members doesn't add much
value, if any (unless I'm missing something).

This patch makes all `struct device` references mutable, so that no
assumptions on how `struct device` is used are made. In the future, one
could e.g. dynamically allocate devices and assign any of the device
fields at runtime.

Signed-off-by: default avatarGerard Marull-Paretas <gerard.marull@nordicsemi.no>
parent e36d4818
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment