Skip to content

Commit cf88ab4

Browse files
krzkbroonie
authored andcommitted
ASoC: Constify pointer to of_phandle_args
Constify pointer to of_phandle_args in few function arguments, for code safety and self-documenting code. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://msgid.link/r/20240216145448.224185-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 74e0259 commit cf88ab4

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

include/sound/soc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,8 +1401,8 @@ void snd_soc_remove_pcm_runtime(struct snd_soc_card *card,
14011401
void snd_soc_dlc_use_cpu_as_platform(struct snd_soc_dai_link_component *platforms,
14021402
struct snd_soc_dai_link_component *cpus);
14031403
struct of_phandle_args *snd_soc_copy_dai_args(struct device *dev,
1404-
struct of_phandle_args *args);
1405-
struct snd_soc_dai *snd_soc_get_dai_via_args(struct of_phandle_args *dai_args);
1404+
const struct of_phandle_args *args);
1405+
struct snd_soc_dai *snd_soc_get_dai_via_args(const struct of_phandle_args *dai_args);
14061406
struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component,
14071407
struct snd_soc_dai_driver *dai_drv,
14081408
bool legacy_dai_naming);

sound/soc/soc-core.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ static inline void snd_soc_debugfs_exit(void) { }
238238

239239
#endif
240240

241-
static int snd_soc_is_match_dai_args(struct of_phandle_args *args1,
242-
struct of_phandle_args *args2)
241+
static int snd_soc_is_match_dai_args(const struct of_phandle_args *args1,
242+
const struct of_phandle_args *args2)
243243
{
244244
if (!args1 || !args2)
245245
return 0;
@@ -831,7 +831,8 @@ static struct device_node
831831
return of_node;
832832
}
833833

834-
struct of_phandle_args *snd_soc_copy_dai_args(struct device *dev, struct of_phandle_args *args)
834+
struct of_phandle_args *snd_soc_copy_dai_args(struct device *dev,
835+
const struct of_phandle_args *args)
835836
{
836837
struct of_phandle_args *ret = devm_kzalloc(dev, sizeof(*ret), GFP_KERNEL);
837838

@@ -3597,7 +3598,7 @@ int snd_soc_of_get_dai_name(struct device_node *of_node,
35973598
}
35983599
EXPORT_SYMBOL_GPL(snd_soc_of_get_dai_name);
35993600

3600-
struct snd_soc_dai *snd_soc_get_dai_via_args(struct of_phandle_args *dai_args)
3601+
struct snd_soc_dai *snd_soc_get_dai_via_args(const struct of_phandle_args *dai_args)
36013602
{
36023603
struct snd_soc_dai *dai;
36033604
struct snd_soc_component *component;

0 commit comments

Comments
 (0)