Skip to content

Commit

Permalink
ASoC: codecs: constify static sdw_slave_ops struct
Browse files Browse the repository at this point in the history
[ Upstream commit 65b7b86 ]

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: 8482221 ("ASoC: codecs: wcd938x: fix accessing regmap on unattached devices")
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
krzk authored and gregkh committed May 17, 2023
1 parent 5279ab1 commit 400950f
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sound/soc/codecs/rt1316-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/rt1318-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/rt711-sdca-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/rt715-sdca-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/wcd938x-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/wsa881x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/wsa883x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down

0 comments on commit 400950f

Please sign in to comment.