Skip to content

Commit bf75ba4

Browse files
plbossartvinodkoul
authored andcommitted
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>
1 parent bb10659 commit bf75ba4

1 file changed

Lines changed: 26 additions & 26 deletions

File tree

drivers/soundwire/stream.c

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,32 @@ struct sdw_stream_runtime *sdw_alloc_stream(const char *stream_name)
10541054
}
10551055
EXPORT_SYMBOL(sdw_alloc_stream);
10561056

1057+
/**
1058+
* sdw_alloc_slave_rt() - Allocate and initialize Slave runtime handle.
1059+
*
1060+
* @slave: Slave handle
1061+
* @stream_config: Stream configuration
1062+
*
1063+
* This function is to be called with bus_lock held.
1064+
*/
1065+
static struct sdw_slave_runtime
1066+
*sdw_alloc_slave_rt(struct sdw_slave *slave,
1067+
struct sdw_stream_config *stream_config)
1068+
{
1069+
struct sdw_slave_runtime *s_rt;
1070+
1071+
s_rt = kzalloc(sizeof(*s_rt), GFP_KERNEL);
1072+
if (!s_rt)
1073+
return NULL;
1074+
1075+
INIT_LIST_HEAD(&s_rt->port_list);
1076+
s_rt->ch_count = stream_config->ch_count;
1077+
s_rt->direction = stream_config->direction;
1078+
s_rt->slave = slave;
1079+
1080+
return s_rt;
1081+
}
1082+
10571083
static struct sdw_master_runtime
10581084
*sdw_master_rt_find(struct sdw_bus *bus,
10591085
struct sdw_stream_runtime *stream)
@@ -1118,32 +1144,6 @@ static int sdw_master_rt_config(struct sdw_master_runtime *m_rt,
11181144
return 0;
11191145
}
11201146

1121-
/**
1122-
* sdw_alloc_slave_rt() - Allocate and initialize Slave runtime handle.
1123-
*
1124-
* @slave: Slave handle
1125-
* @stream_config: Stream configuration
1126-
*
1127-
* This function is to be called with bus_lock held.
1128-
*/
1129-
static struct sdw_slave_runtime
1130-
*sdw_alloc_slave_rt(struct sdw_slave *slave,
1131-
struct sdw_stream_config *stream_config)
1132-
{
1133-
struct sdw_slave_runtime *s_rt;
1134-
1135-
s_rt = kzalloc(sizeof(*s_rt), GFP_KERNEL);
1136-
if (!s_rt)
1137-
return NULL;
1138-
1139-
INIT_LIST_HEAD(&s_rt->port_list);
1140-
s_rt->ch_count = stream_config->ch_count;
1141-
s_rt->direction = stream_config->direction;
1142-
s_rt->slave = slave;
1143-
1144-
return s_rt;
1145-
}
1146-
11471147
/**
11481148
* sdw_release_slave_stream() - Free Slave(s) runtime handle
11491149
*

0 commit comments

Comments
 (0)