summaryrefslogtreecommitdiff
path: root/drivers/soundwire
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2022-01-26 09:17:07 +0800
committerVinod Koul <vkoul@kernel.org>2022-02-11 12:15:37 +0530
commitbf75ba4bdba85c9f53245526040d9a75399918a7 (patch)
treee5a267702858ee949cd73f5f97b2c2ae9920fb08 /drivers/soundwire
parentbb10659a6f84c21a5a04bff43908eb4014393cf2 (diff)
soundwire: stream: move sdw_alloc_slave_rt() before 'master' helpers
Code move before splitting the function in two. No functionality change. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20220126011715.28204-12-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/soundwire')
-rw-r--r--drivers/soundwire/stream.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c
index e38c9208c77b..eef2e5fd245e 100644
--- a/drivers/soundwire/stream.c
+++ b/drivers/soundwire/stream.c
@@ -1054,6 +1054,32 @@ struct sdw_stream_runtime *sdw_alloc_stream(const char *stream_name)
}
EXPORT_SYMBOL(sdw_alloc_stream);
+/**
+ * sdw_alloc_slave_rt() - Allocate and initialize Slave runtime handle.
+ *
+ * @slave: Slave handle
+ * @stream_config: Stream configuration
+ *
+ * This function is to be called with bus_lock held.
+ */
+static struct sdw_slave_runtime
+*sdw_alloc_slave_rt(struct sdw_slave *slave,
+ struct sdw_stream_config *stream_config)
+{
+ struct sdw_slave_runtime *s_rt;
+
+ s_rt = kzalloc(sizeof(*s_rt), GFP_KERNEL);
+ if (!s_rt)
+ return NULL;
+
+ INIT_LIST_HEAD(&s_rt->port_list);
+ s_rt->ch_count = stream_config->ch_count;
+ s_rt->direction = stream_config->direction;
+ s_rt->slave = slave;
+
+ return s_rt;
+}
+
static struct sdw_master_runtime
*sdw_master_rt_find(struct sdw_bus *bus,
struct sdw_stream_runtime *stream)
@@ -1119,32 +1145,6 @@ static int sdw_master_rt_config(struct sdw_master_runtime *m_rt,
}
/**
- * sdw_alloc_slave_rt() - Allocate and initialize Slave runtime handle.
- *
- * @slave: Slave handle
- * @stream_config: Stream configuration
- *
- * This function is to be called with bus_lock held.
- */
-static struct sdw_slave_runtime
-*sdw_alloc_slave_rt(struct sdw_slave *slave,
- struct sdw_stream_config *stream_config)
-{
- struct sdw_slave_runtime *s_rt;
-
- s_rt = kzalloc(sizeof(*s_rt), GFP_KERNEL);
- if (!s_rt)
- return NULL;
-
- INIT_LIST_HEAD(&s_rt->port_list);
- s_rt->ch_count = stream_config->ch_count;
- s_rt->direction = stream_config->direction;
- s_rt->slave = slave;
-
- return s_rt;
-}
-
-/**
* sdw_release_slave_stream() - Free Slave(s) runtime handle
*
* @slave: Slave handle.