sof/test
Andy Ross b08effa8e9 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>
2024-06-18 14:25:20 +03:00
..
cmocka comp_dev: Eliminate use of drvdata for module backpointer 2024-06-18 14:25:20 +03:00
CMakeLists.txt cmake: add spdx license identifier 2019-06-02 16:38:17 +01:00
test-all-defconfigs.sh cmocka/test-all-defconfig.sh: add banners between platforms 2021-12-20 22:34:03 +00:00