-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Description
Is your enhancement proposal related to a problem? Please describe.
Currently, struct device
s are defined and accessed using macros such as DEVICE_DT_DEFINE
, DEVICE_DT_INST_DEFINE
, and DEVICE_DT_NAME_GET
. Each of these create a structure based on devicetree contents. There is also DEVICE_DEFINE
, which creates a struct device
outside the context of the devicetree.
struct emul
s are defined and accessed using EMUL_DEFINE
and EMUL_REG_NAME
. These are analogous to DEVICE_DT_DEFINE
and DEVICE_DT_NAME_GET
, respectively, in that they take node IDs as parameters. EMUL_DEFINE
also takes its data_ptr
and cfg_ptr
parameters in the opposite order from DEVICE_DT_DEFINE
.
This inconsistent naming somewhat obscures the purpose of the emulator macros.
Describe the solution you'd like
- Create aliases
EMUL_DT_DEFINE
andEMUL_DT_NAME_GET
forEMUL_DEFINE
andEMUL_REG_NAME
. - Replace uses of the old macros with usages of the new macros.
- Mark the old macros
@deprecated
. - Delete the old macros after a suitable transition period.
Describe alternatives you've considered
Continuing to use the old names in future work would work, but it would slightly increase the learning burden for new development compared to making them uniform with the set of names for devices.
Additional context
Some related work in #44883.
@yperess Can you assign this to me?