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>
This commit is contained in:
Krzysztof Kozlowski 2024-02-16 15:54:48 +01:00 committed by Mark Brown
parent 74e0259495
commit cf88ab486a
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
2 changed files with 7 additions and 6 deletions

View File

@ -1401,8 +1401,8 @@ void snd_soc_remove_pcm_runtime(struct snd_soc_card *card,
void snd_soc_dlc_use_cpu_as_platform(struct snd_soc_dai_link_component *platforms,
struct snd_soc_dai_link_component *cpus);
struct of_phandle_args *snd_soc_copy_dai_args(struct device *dev,
struct of_phandle_args *args);
struct snd_soc_dai *snd_soc_get_dai_via_args(struct of_phandle_args *dai_args);
const struct of_phandle_args *args);
struct snd_soc_dai *snd_soc_get_dai_via_args(const struct of_phandle_args *dai_args);
struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component,
struct snd_soc_dai_driver *dai_drv,
bool legacy_dai_naming);

View File

@ -238,8 +238,8 @@ static inline void snd_soc_debugfs_exit(void) { }
#endif
static int snd_soc_is_match_dai_args(struct of_phandle_args *args1,
struct of_phandle_args *args2)
static int snd_soc_is_match_dai_args(const struct of_phandle_args *args1,
const struct of_phandle_args *args2)
{
if (!args1 || !args2)
return 0;
@ -831,7 +831,8 @@ static struct device_node
return of_node;
}
struct of_phandle_args *snd_soc_copy_dai_args(struct device *dev, struct of_phandle_args *args)
struct of_phandle_args *snd_soc_copy_dai_args(struct device *dev,
const struct of_phandle_args *args)
{
struct of_phandle_args *ret = devm_kzalloc(dev, sizeof(*ret), GFP_KERNEL);
@ -3597,7 +3598,7 @@ int snd_soc_of_get_dai_name(struct device_node *of_node,
}
EXPORT_SYMBOL_GPL(snd_soc_of_get_dai_name);
struct snd_soc_dai *snd_soc_get_dai_via_args(struct of_phandle_args *dai_args)
struct snd_soc_dai *snd_soc_get_dai_via_args(const struct of_phandle_args *dai_args)
{
struct snd_soc_dai *dai;
struct snd_soc_component *component;