提交 823ca885 编写于 作者: P Pierre-Louis Bossart 提交者: Vinod Koul

soundwire: stream: add slave runtime to list earlier

sdw_config_stream() only verifies the compatibility between
information provided by the Slave driver and the stream configuration.

There is no problem if we add the slave runtime to the list earlier.
Signed-off-by: NPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: NRander Wang <rander.wang@intel.com>
Signed-off-by: NBard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220126011715.28204-3-yung-chuan.liao@linux.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
上级 ad027fa2
...@@ -1373,20 +1373,11 @@ int sdw_stream_add_slave(struct sdw_slave *slave, ...@@ -1373,20 +1373,11 @@ int sdw_stream_add_slave(struct sdw_slave *slave,
ret = -ENOMEM; ret = -ENOMEM;
goto stream_error; goto stream_error;
} }
list_add_tail(&s_rt->m_rt_node, &m_rt->slave_rt_list);
ret = sdw_config_stream(&slave->dev, stream, stream_config, true); ret = sdw_config_stream(&slave->dev, stream, stream_config, true);
if (ret) { if (ret)
/*
* sdw_release_master_stream will release s_rt in slave_rt_list in
* stream_error case, but s_rt is only added to slave_rt_list
* when sdw_config_stream is successful, so free s_rt explicitly
* when sdw_config_stream is failed.
*/
kfree(s_rt);
goto stream_error; goto stream_error;
}
list_add_tail(&s_rt->m_rt_node, &m_rt->slave_rt_list);
ret = sdw_slave_port_config(slave, s_rt, port_config, num_ports); ret = sdw_slave_port_config(slave, s_rt, port_config, num_ports);
if (ret) if (ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册