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:
Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Loading
Please sign in to comment