aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/soundwire
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>2023-11-20 18:47:20 +0100
committerVinod Koul <vkoul@kernel.org>2023-11-23 12:46:20 +0530
commit21f4c443731fdb064c0dd31a743aafd0b075156c (patch)
tree87527795b47eb646e67edd29d33e16913de69608 /drivers/soundwire
parent5bdc61ef45007908df9d8587111c7a5a552bdd46 (diff)
downloadlinux-21f4c443731fdb064c0dd31a743aafd0b075156c.tar.gz
soundwire: stream: constify sdw_port_config when adding devices
sdw_stream_add_master() and sdw_stream_add_slave() do not modify contents of passed sdw_port_config, so it can be made const for code safety and as documentation of expected usage. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20231120174720.239610-1-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/soundwire')
-rw-r--r--drivers/soundwire/stream.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c
index 69719b335bcb1..9dc6399f206af 100644
--- a/drivers/soundwire/stream.c
+++ b/drivers/soundwire/stream.c
@@ -897,7 +897,7 @@ static struct sdw_port_runtime *sdw_port_alloc(struct list_head *port_list)
}
static int sdw_port_config(struct sdw_port_runtime *p_rt,
- struct sdw_port_config *port_config,
+ const struct sdw_port_config *port_config,
int port_index)
{
p_rt->ch_mask = port_config[port_index].ch_mask;
@@ -970,7 +970,7 @@ static int sdw_slave_port_is_valid_range(struct device *dev, int num)
static int sdw_slave_port_config(struct sdw_slave *slave,
struct sdw_slave_runtime *s_rt,
- struct sdw_port_config *port_config)
+ const struct sdw_port_config *port_config)
{
struct sdw_port_runtime *p_rt;
int ret;
@@ -1026,7 +1026,7 @@ static int sdw_master_port_alloc(struct sdw_master_runtime *m_rt,
}
static int sdw_master_port_config(struct sdw_master_runtime *m_rt,
- struct sdw_port_config *port_config)
+ const struct sdw_port_config *port_config)
{
struct sdw_port_runtime *p_rt;
int ret;
@@ -1861,7 +1861,7 @@ EXPORT_SYMBOL(sdw_release_stream);
*/
int sdw_stream_add_master(struct sdw_bus *bus,
struct sdw_stream_config *stream_config,
- struct sdw_port_config *port_config,
+ const struct sdw_port_config *port_config,
unsigned int num_ports,
struct sdw_stream_runtime *stream)
{
@@ -1981,7 +1981,7 @@ EXPORT_SYMBOL(sdw_stream_remove_master);
*/
int sdw_stream_add_slave(struct sdw_slave *slave,
struct sdw_stream_config *stream_config,
- struct sdw_port_config *port_config,
+ const struct sdw_port_config *port_config,
unsigned int num_ports,
struct sdw_stream_runtime *stream)
{