-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Description
Is your enhancement proposal related to a problem? Please describe.
EMUL_DT_GET
will provide a mechanism to statically get a reference to a struct emul
based on the device tree. Generally, it should be possible and preferable to get emulator references statically. emul_get_binding
currently provides a mechanism to get them dynamically.
Describe the solution you'd like
Deprecate emul_get_binding
. Provide a function struct emul *emul_get_device(struct device *)
, which will dynamically get the emulator corresponding to a specified device.
Describe alternatives you've considered
- Continue to use
emul_get_binding
: This is potentially time-consuming and can fail at runtime. - Something about not having
emul_get_device
, to be elaborated by @galak.
Additional context
See request from @galak in #44883 (comment).
@galak Did I miss anything? Is that what you were thinking for emul_get_device
? What is the use case for emul_get_device
?