فهرست منبع

ASoC: Drop const from struct snd_soc_dai_link *of_node members

Dropping the const qualifiers prevents "passing argument 1 of ‘of_node_put’
discards ‘const’ qualifier from pointer target type" type warnings when
compiling the code dropping reference to cpu_of_node, codec_of_node or
platform_of_node with with an of_node_put() function call.

This lets us to avoid casting to struct device_node * or caching variables
internally in drivers just to be able to properly drop a reference to the
OF node on clean up paths.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Sylwester Nawrocki 11 سال پیش
والد
کامیت
8ad9f9efcc
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      include/sound/soc.h

+ 3 - 3
include/sound/soc.h

@@ -897,7 +897,7 @@ struct snd_soc_dai_link {
 	 * only for codec to codec links, or systems using device tree.
 	 * only for codec to codec links, or systems using device tree.
 	 */
 	 */
 	const char *cpu_name;
 	const char *cpu_name;
-	const struct device_node *cpu_of_node;
+	struct device_node *cpu_of_node;
 	/*
 	/*
 	 * You MAY specify the DAI name of the CPU DAI. If this information is
 	 * You MAY specify the DAI name of the CPU DAI. If this information is
 	 * omitted, the CPU-side DAI is matched using .cpu_name/.cpu_of_node
 	 * omitted, the CPU-side DAI is matched using .cpu_name/.cpu_of_node
@@ -909,7 +909,7 @@ struct snd_soc_dai_link {
 	 * DT/OF node, but not both.
 	 * DT/OF node, but not both.
 	 */
 	 */
 	const char *codec_name;
 	const char *codec_name;
-	const struct device_node *codec_of_node;
+	struct device_node *codec_of_node;
 	/* You MUST specify the DAI name within the codec */
 	/* You MUST specify the DAI name within the codec */
 	const char *codec_dai_name;
 	const char *codec_dai_name;
 
 
@@ -922,7 +922,7 @@ struct snd_soc_dai_link {
 	 * do not need a platform.
 	 * do not need a platform.
 	 */
 	 */
 	const char *platform_name;
 	const char *platform_name;
-	const struct device_node *platform_of_node;
+	struct device_node *platform_of_node;
 	int be_id;	/* optional ID for machine driver BE identification */
 	int be_id;	/* optional ID for machine driver BE identification */
 
 
 	const struct snd_soc_pcm_stream *params;
 	const struct snd_soc_pcm_stream *params;