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 afd2c3b..1c22699 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 b49f1e1..0b7ac74 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 4001612..ff9c081 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 2beb428..8f5ebe9 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 71dd3b9..81a1dd7 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,