]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ASoC: rt*: Constify static struct sdw_slave_ops
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Wed, 24 Feb 2021 21:19:15 +0000 (22:19 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 10 Mar 2021 13:06:32 +0000 (13:06 +0000)
The only usage of these is to assign their address to the ops field in
the sdw_driver struct, which is a pointer to const. Make them const to
allow the compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210224211918.39109-2-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt1308-sdw.c
sound/soc/codecs/rt5682-sdw.c
sound/soc/codecs/rt700-sdw.c
sound/soc/codecs/rt711-sdw.c
sound/soc/codecs/rt715-sdw.c

index afd2c3b687ccb0af96a682e8d22b03d30a42e31a..1c226994aebd8fbc92badce5d3855dab5de745c9 100644 (file)
@@ -594,7 +594,7 @@ static int rt1308_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 rt1308_slave_ops = {
+static const struct sdw_slave_ops rt1308_slave_ops = {
        .read_prop = rt1308_read_prop,
        .interrupt_callback = rt1308_interrupt_callback,
        .update_status = rt1308_update_status,
index b49f1e16125d49676ada14347c2cbfe8d00f356e..0b7ac74e671d248c74376106935e1fd333b45ce1 100644 (file)
@@ -683,7 +683,7 @@ static int rt5682_interrupt_callback(struct sdw_slave *slave,
        return 0;
 }
 
-static struct sdw_slave_ops rt5682_slave_ops = {
+static const struct sdw_slave_ops rt5682_slave_ops = {
        .read_prop = rt5682_read_prop,
        .interrupt_callback = rt5682_interrupt_callback,
        .update_status = rt5682_update_status,
index 4001612dfd7378c9d101736e1d33aaade2e47bd6..ff9c081fd52af53ad226d1b0d6084df09a2aeedd 100644 (file)
@@ -430,7 +430,7 @@ static int rt700_interrupt_callback(struct sdw_slave *slave,
  * slave_ops: callbacks for get_clock_stop_mode, clock_stop and
  * port_prep are not defined for now
  */
-static struct sdw_slave_ops rt700_slave_ops = {
+static const struct sdw_slave_ops rt700_slave_ops = {
        .read_prop = rt700_read_prop,
        .interrupt_callback = rt700_interrupt_callback,
        .update_status = rt700_update_status,
index 2beb4286d997bf5d050881bb7f0288ec480f5d16..8f5ebe92d40767f378e8910c5650dba37df04a54 100644 (file)
@@ -431,7 +431,7 @@ static int rt711_interrupt_callback(struct sdw_slave *slave,
        return 0;
 }
 
-static struct sdw_slave_ops rt711_slave_ops = {
+static const struct sdw_slave_ops rt711_slave_ops = {
        .read_prop = rt711_read_prop,
        .interrupt_callback = rt711_interrupt_callback,
        .update_status = rt711_update_status,
index 71dd3b97a459040eaf2d04c436a383f945a8072d..81a1dd77b6f6934c3d7b3225c042779097798528 100644 (file)
@@ -488,7 +488,7 @@ static int rt715_bus_config(struct sdw_slave *slave,
        return 0;
 }
 
-static struct sdw_slave_ops rt715_slave_ops = {
+static const struct sdw_slave_ops rt715_slave_ops = {
        .read_prop = rt715_read_prop,
        .update_status = rt715_update_status,
        .bus_config = rt715_bus_config,