ASoC: Constify DAI passed to get_channel_map
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 17 Jun 2024 13:03:22 +0000 (15:03 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 18 Jun 2024 13:19:55 +0000 (14:19 +0100)
get_channel_map() is supposed to obtain map of channels without
modifying the state of the given DAI, so make the pointer to 'struct
snd_soc_dai' as pointing to const.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240617-n-asoc-const-auto-selectable-formats-v1-4-8004f346ee38@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc-dai.h
sound/soc/codecs/lpass-rx-macro.c
sound/soc/codecs/lpass-tx-macro.c
sound/soc/codecs/lpass-va-macro.c
sound/soc/codecs/lpass-wsa-macro.c
sound/soc/codecs/wcd9335.c
sound/soc/codecs/wcd934x.c
sound/soc/soc-dai.c

index 3c45b418270ee60309d06277de59b8c47e1dc27d..f22969298de1fa3943646d271e4f486f69c5413e 100644 (file)
@@ -198,7 +198,7 @@ int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute,
                             int direction);
 
 
-int snd_soc_dai_get_channel_map(struct snd_soc_dai *dai,
+int snd_soc_dai_get_channel_map(const struct snd_soc_dai *dai,
                unsigned int *tx_num, unsigned int *tx_slot,
                unsigned int *rx_num, unsigned int *rx_slot);
 
@@ -307,7 +307,7 @@ struct snd_soc_dai_ops {
        int (*set_channel_map)(struct snd_soc_dai *dai,
                unsigned int tx_num, const unsigned int *tx_slot,
                unsigned int rx_num, const unsigned int *rx_slot);
-       int (*get_channel_map)(struct snd_soc_dai *dai,
+       int (*get_channel_map)(const struct snd_soc_dai *dai,
                        unsigned int *tx_num, unsigned int *tx_slot,
                        unsigned int *rx_num, unsigned int *rx_slot);
        int (*set_tristate)(struct snd_soc_dai *dai, int tristate);
index 00ecc470ba8bda51b2bbab887b0d756ec7f2d724..83791507ed132ea288bb5c41be6a073d8ace6123 100644 (file)
@@ -1833,7 +1833,7 @@ static int rx_macro_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static int rx_macro_get_channel_map(struct snd_soc_dai *dai,
+static int rx_macro_get_channel_map(const struct snd_soc_dai *dai,
                                    unsigned int *tx_num, unsigned int *tx_slot,
                                    unsigned int *rx_num, unsigned int *rx_slot)
 {
index c98b0b747a92513636a93dc09db6b079b6ccb74c..209c12ec16ddf1fca0aa59fc413e4ab00e200bfe 100644 (file)
@@ -1167,7 +1167,7 @@ static int tx_macro_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static int tx_macro_get_channel_map(struct snd_soc_dai *dai,
+static int tx_macro_get_channel_map(const struct snd_soc_dai *dai,
                                    unsigned int *tx_num, unsigned int *tx_slot,
                                    unsigned int *rx_num, unsigned int *rx_slot)
 {
index a555e1e078eb1027e4d41778eb00938dc1aa3429..b0006f4ce8a220ce02bbd0efa99b5cc0c4dd3645 100644 (file)
@@ -892,7 +892,7 @@ static int va_macro_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static int va_macro_get_channel_map(struct snd_soc_dai *dai,
+static int va_macro_get_channel_map(const struct snd_soc_dai *dai,
                                    unsigned int *tx_num, unsigned int *tx_slot,
                                    unsigned int *rx_num, unsigned int *rx_slot)
 {
index 6ce309980cd10e200dc62a1941b07f6f7728d3cd..1e19c2b28a4f45fa8b6ae554554103d500aca191 100644 (file)
@@ -992,7 +992,7 @@ static int wsa_macro_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static int wsa_macro_get_channel_map(struct snd_soc_dai *dai,
+static int wsa_macro_get_channel_map(const struct snd_soc_dai *dai,
                                     unsigned int *tx_num, unsigned int *tx_slot,
                                     unsigned int *rx_num, unsigned int *rx_slot)
 {
index 42a99978fe5ab333825157112241477a9b381092..fc0ab00a253f2484f56242b86ec02409ec3ceb84 100644 (file)
@@ -2014,7 +2014,7 @@ static int wcd9335_set_channel_map(struct snd_soc_dai *dai,
        return 0;
 }
 
-static int wcd9335_get_channel_map(struct snd_soc_dai *dai,
+static int wcd9335_get_channel_map(const struct snd_soc_dai *dai,
                                   unsigned int *tx_num, unsigned int *tx_slot,
                                   unsigned int *rx_num, unsigned int *rx_slot)
 {
index fcad2c9fba550df6feab9dac850e9e47f6b9f6b4..b5a929659dc8377a1d1056433698f1c98f2ce428 100644 (file)
@@ -1960,7 +1960,7 @@ static int wcd934x_set_channel_map(struct snd_soc_dai *dai,
        return 0;
 }
 
-static int wcd934x_get_channel_map(struct snd_soc_dai *dai,
+static int wcd934x_get_channel_map(const struct snd_soc_dai *dai,
                                   unsigned int *tx_num, unsigned int *tx_slot,
                                   unsigned int *rx_num, unsigned int *rx_slot)
 {
index 55d1a5a099df4c540abf7d488d4e6fbe1fb6c7f6..0c3a834e504de89b72a6bdfa9d18908a3dfc26fb 100644 (file)
@@ -11,7 +11,7 @@
 #include <sound/soc-link.h>
 
 #define soc_dai_ret(dai, ret) _soc_dai_ret(dai, __func__, ret)
-static inline int _soc_dai_ret(struct snd_soc_dai *dai,
+static inline int _soc_dai_ret(const struct snd_soc_dai *dai,
                               const char *func, int ret)
 {
        /* Positive, Zero values are not errors */
@@ -327,7 +327,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_channel_map);
  * @rx_slot: pointer to an array which imply the RX slot number channel
  *           0~num-1 uses
  */
-int snd_soc_dai_get_channel_map(struct snd_soc_dai *dai,
+int snd_soc_dai_get_channel_map(const struct snd_soc_dai *dai,
                                unsigned int *tx_num, unsigned int *tx_slot,
                                unsigned int *rx_num, unsigned int *rx_slot)
 {