component: initialize new devices to INIT state

As per component graph we start devices in INIT state. Since most
components don't use this state anyways lets just init the struct to
this state and remove it where it is used correctly.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
This commit is contained in:
Curtis Malainey 2020-10-14 11:12:47 -07:00 committed by Liam Girdwood
parent 8a5059a8c0
commit 1512a49bfa
4 changed files with 1 additions and 6 deletions

View File

@ -167,8 +167,6 @@ static struct comp_dev *drc_new(const struct comp_driver *drv,
sizeof(struct sof_ipc_comp_process));
assert(!ret);
dev->state = COMP_STATE_INIT;
cd = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(*cd));
if (!cd) {
rfree(dev);

View File

@ -136,8 +136,6 @@ static struct comp_dev *mux_new(const struct comp_driver *drv,
if (!dev)
return NULL;
dev->state = COMP_STATE_INIT;
memcpy_s(COMP_GET_IPC(dev, sof_ipc_comp_process),
sizeof(struct sof_ipc_comp_process),
comp, sizeof(struct sof_ipc_comp_process));

View File

@ -269,8 +269,6 @@ static struct comp_dev *tdfb_new(const struct comp_driver *drv,
sizeof(struct sof_ipc_comp_process), ipc_tdfb,
sizeof(struct sof_ipc_comp_process));
dev->state = COMP_STATE_INIT;
cd = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(*cd));
if (!cd) {
rfree(dev);

View File

@ -546,6 +546,7 @@ static inline struct comp_dev *comp_alloc(const struct comp_driver *drv,
return NULL;
dev->size = bytes;
dev->drv = drv;
dev->state = COMP_STATE_INIT;
memcpy_s(&dev->tctx, sizeof(struct tr_ctx),
trace_comp_drv_get_tr_ctx(dev->drv), sizeof(struct tr_ctx));