mirror of https://github.com/thesofproject/sof.git
testbench: Add UUID for file component
Each component driver should have assigned UUID value and trace contecxt, to allow generic component creation routine usage. It's espiecially important for trace context, because it's accessed by pointer so dereferencing NULL pointer will lead to segmentation fault. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This commit is contained in:
parent
c6f1609c51
commit
27d4c943f3
|
@ -21,6 +21,11 @@
|
||||||
#include "testbench/common_test.h"
|
#include "testbench/common_test.h"
|
||||||
#include "testbench/file.h"
|
#include "testbench/file.h"
|
||||||
|
|
||||||
|
/* bfc7488c-75aa-4ce8-9bde-d8da08a698c2 */
|
||||||
|
DECLARE_SOF_UUID("file", file_uuid, 0xbfc7488c, 0x75aa, 0x4ce8,
|
||||||
|
0x9d, 0xbe, 0xd8, 0xda, 0x08, 0xa6, 0x98, 0xc2);
|
||||||
|
DECLARE_TR_CTX(file_tr, SOF_UUID(file_uuid), LOG_LEVEL_INFO);
|
||||||
|
|
||||||
static const struct comp_driver comp_file_dai;
|
static const struct comp_driver comp_file_dai;
|
||||||
static const struct comp_driver comp_file_host;
|
static const struct comp_driver comp_file_host;
|
||||||
|
|
||||||
|
@ -759,6 +764,8 @@ static int file_get_hw_params(struct comp_dev *dev,
|
||||||
|
|
||||||
static const struct comp_driver comp_file_host = {
|
static const struct comp_driver comp_file_host = {
|
||||||
.type = SOF_COMP_HOST,
|
.type = SOF_COMP_HOST,
|
||||||
|
.uid = SOF_UUID(file_tr),
|
||||||
|
.tctx = &file_tr,
|
||||||
.ops = {
|
.ops = {
|
||||||
.create = file_new,
|
.create = file_new,
|
||||||
.free = file_free,
|
.free = file_free,
|
||||||
|
@ -769,10 +776,13 @@ static const struct comp_driver comp_file_host = {
|
||||||
.prepare = file_prepare,
|
.prepare = file_prepare,
|
||||||
.reset = file_reset,
|
.reset = file_reset,
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct comp_driver comp_file_dai = {
|
static const struct comp_driver comp_file_dai = {
|
||||||
.type = SOF_COMP_DAI,
|
.type = SOF_COMP_DAI,
|
||||||
|
.uid = SOF_UUID(file_tr),
|
||||||
|
.tctx = &file_tr,
|
||||||
.ops = {
|
.ops = {
|
||||||
.create = file_new,
|
.create = file_new,
|
||||||
.free = file_free,
|
.free = file_free,
|
||||||
|
|
Loading…
Reference in New Issue