]> git.itanic.dy.fi Git - linux-stable/commitdiff
ASoC: codecs: constify static sdw_slave_ops struct
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tue, 24 Jan 2023 16:39:51 +0000 (17:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:53:55 +0000 (11:53 +0200)
[ Upstream commit 65b7b869da9bd3bd0b9fa60e6fe557bfbc0a75e8 ]

The struct sdw_slave_ops is not modified and sdw_driver takes pointer to
const, so make it a const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230124163953.345949-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 84822215acd1 ("ASoC: codecs: wcd938x: fix accessing regmap on unattached devices")
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/codecs/rt1316-sdw.c
sound/soc/codecs/rt1318-sdw.c
sound/soc/codecs/rt711-sdca-sdw.c
sound/soc/codecs/rt715-sdca-sdw.c
sound/soc/codecs/wcd938x-sdw.c
sound/soc/codecs/wsa881x.c
sound/soc/codecs/wsa883x.c

index ed0a114363621026cafdf1e4f9841ff89507a4e2..154b6179b6dcd5c2fb6742ce72fd9e0771345d34 100644 (file)
@@ -585,7 +585,7 @@ static int rt1316_sdw_pcm_hw_free(struct snd_pcm_substream *substream,
  * slave_ops: callbacks for get_clock_stop_mode, clock_stop and
  * port_prep are not defined for now
  */
-static struct sdw_slave_ops rt1316_slave_ops = {
+static const struct sdw_slave_ops rt1316_slave_ops = {
        .read_prop = rt1316_read_prop,
        .update_status = rt1316_update_status,
 };
index f85f5ab2c6d048285faa6b78e691927793f0e4f4..c6ec86e97a6e723d793ea70dd82f15f7923c4aa4 100644 (file)
@@ -697,7 +697,7 @@ static int rt1318_sdw_pcm_hw_free(struct snd_pcm_substream *substream,
  * slave_ops: callbacks for get_clock_stop_mode, clock_stop and
  * port_prep are not defined for now
  */
-static struct sdw_slave_ops rt1318_slave_ops = {
+static const struct sdw_slave_ops rt1318_slave_ops = {
        .read_prop = rt1318_read_prop,
        .update_status = rt1318_update_status,
 };
index 88a8392a58edb5b33cf08f8bf72315ba17f3f81e..e23cec4c457dee0f90503079ac1b3a5fddef7844 100644 (file)
@@ -338,7 +338,7 @@ static int rt711_sdca_interrupt_callback(struct sdw_slave *slave,
        return ret;
 }
 
-static struct sdw_slave_ops rt711_sdca_slave_ops = {
+static const struct sdw_slave_ops rt711_sdca_slave_ops = {
        .read_prop = rt711_sdca_read_prop,
        .interrupt_callback = rt711_sdca_interrupt_callback,
        .update_status = rt711_sdca_update_status,
index c54ecf3e69879d10a9b0be6ad7bf1b8263038cc4..38a82e4e2f952517194ab794250f4b7d894ad8e9 100644 (file)
@@ -172,7 +172,7 @@ static int rt715_sdca_read_prop(struct sdw_slave *slave)
        return 0;
 }
 
-static struct sdw_slave_ops rt715_sdca_slave_ops = {
+static const struct sdw_slave_ops rt715_sdca_slave_ops = {
        .read_prop = rt715_sdca_read_prop,
        .update_status = rt715_sdca_update_status,
 };
index 1bf3c06a2b6221613a45f969be1b598e152bdd18..33d1b5ffeaeba7ae4f45f2fe62eb25dc44498b8b 100644 (file)
@@ -191,7 +191,7 @@ static int wcd9380_interrupt_callback(struct sdw_slave *slave,
        return IRQ_HANDLED;
 }
 
-static struct sdw_slave_ops wcd9380_slave_ops = {
+static const struct sdw_slave_ops wcd9380_slave_ops = {
        .update_status = wcd9380_update_status,
        .interrupt_callback = wcd9380_interrupt_callback,
        .bus_config = wcd9380_bus_config,
index 6c8b1db649b8988b28e1c7ebcdc11cec7d2ee122..046843b57b03850890f296b887412f4654047a9c 100644 (file)
@@ -1101,7 +1101,7 @@ static int wsa881x_bus_config(struct sdw_slave *slave,
        return 0;
 }
 
-static struct sdw_slave_ops wsa881x_slave_ops = {
+static const struct sdw_slave_ops wsa881x_slave_ops = {
        .update_status = wsa881x_update_status,
        .bus_config = wsa881x_bus_config,
        .port_prep = wsa881x_port_prep,
index 2533d0973529fcba6baa191175adf51e188265a7..6e9a64c5948e2626a1d0bf0b4d4d3b13ab84c883 100644 (file)
@@ -1073,7 +1073,7 @@ static int wsa883x_port_prep(struct sdw_slave *slave,
        return 0;
 }
 
-static struct sdw_slave_ops wsa883x_slave_ops = {
+static const struct sdw_slave_ops wsa883x_slave_ops = {
        .update_status = wsa883x_update_status,
        .port_prep = wsa883x_port_prep,
 };