You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
comp_dev: Eliminate use of drvdata for module backpointer
The current SOF architecture splits a "module" across two structs, the
legacy comp_dev and a newer struct processing_module. The latter
contains a pointer to the former, but in many places existing code has
needed a backpointer to recover the module from a component.
So far this has abused the drvdata mechanism to store this as a void*,
but that's fragile as many components are already (!) using drvdata
for other purposes and will clobber the setting. The fact that it
worked is seeming just by luck. That pointer is for the exclusive use
of the comp_driver code associated with a component to store its own
data. We can't be touching it from the global module code.
Just give the pointer a properly-typed field of its own and make sure
the two are initialized in tandem. Longer term, SOF really needs to
fix this bifurcation and unify the two structs.
Signed-off-by: Andy Ross <andyross@google.com>
0 commit comments