]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: codecs: wcd938x: Constify wcd938x_sdw_ch_info
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Wed, 12 Jun 2024 16:15:30 +0000 (18:15 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 18 Jun 2024 15:47:29 +0000 (16:47 +0100)
Driver does not modify static wcd938x_sdw_ch_info array, so it can be
made const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://msgid.link/r/20240612-asoc-wcd9xxx-wide-cleanups-v1-17-0d15885b2a06@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wcd938x-sdw.c
sound/soc/codecs/wcd938x.c
sound/soc/codecs/wcd938x.h

index a1f04010da95f60278071292254d4f3489a40bba..c995bcc59eadb4f2c726267b48044bb3dc6e8c93 100644 (file)
@@ -21,7 +21,7 @@
 
 #define SWRS_SCP_HOST_CLK_DIV2_CTL_BANK(m) (0xE0 + 0x10 * (m))
 
-static struct wcd938x_sdw_ch_info wcd938x_sdw_rx_ch_info[] = {
+static const struct wcd938x_sdw_ch_info wcd938x_sdw_rx_ch_info[] = {
        WCD_SDW_CH(WCD938X_HPH_L, WCD938X_HPH_PORT, BIT(0)),
        WCD_SDW_CH(WCD938X_HPH_R, WCD938X_HPH_PORT, BIT(1)),
        WCD_SDW_CH(WCD938X_CLSH, WCD938X_CLSH_PORT, BIT(0)),
@@ -32,7 +32,7 @@ static struct wcd938x_sdw_ch_info wcd938x_sdw_rx_ch_info[] = {
        WCD_SDW_CH(WCD938X_DSD_R, WCD938X_DSD_PORT, BIT(1)),
 };
 
-static struct wcd938x_sdw_ch_info wcd938x_sdw_tx_ch_info[] = {
+static const struct wcd938x_sdw_ch_info wcd938x_sdw_tx_ch_info[] = {
        WCD_SDW_CH(WCD938X_ADC1, WCD938X_ADC_1_2_PORT, BIT(0)),
        WCD_SDW_CH(WCD938X_ADC2, WCD938X_ADC_1_2_PORT, BIT(1)),
        WCD_SDW_CH(WCD938X_ADC3, WCD938X_ADC_3_4_PORT, BIT(0)),
index 124c18712422ea1138b267b10153b716e7d40a39..12b32d5dc5807bedd3d9fc5800ffc45d77e11510 100644 (file)
@@ -418,7 +418,7 @@ static int wcd938x_io_init(struct wcd938x_priv *wcd938x)
 
 }
 
-static int wcd938x_sdw_connect_port(struct wcd938x_sdw_ch_info *ch_info,
+static int wcd938x_sdw_connect_port(const struct wcd938x_sdw_ch_info *ch_info,
                                    struct sdw_port_config *port_config,
                                    u8 enable)
 {
index 0d332cb555acfa4cc83c6df9bafdeda4fd56763f..09e39a19fbe4262f3640cfc5545e0cf11a594e5a 100644 (file)
@@ -653,7 +653,7 @@ struct wcd938x_sdw_priv {
        struct sdw_stream_config sconfig;
        struct sdw_stream_runtime *sruntime;
        struct sdw_port_config port_config[WCD938X_MAX_SWR_PORTS];
-       struct wcd938x_sdw_ch_info *ch_info;
+       const struct wcd938x_sdw_ch_info *ch_info;
        bool port_enable[WCD938X_MAX_SWR_CH_IDS];
        int active_ports;
        int num_ports;