diff mbox

ASoC: rt5631: Fixing compilation warning when DT is disabled

Message ID 1416232589-31319-1-git-send-email-krishna.md@samsung.com (mailing list archive)
State Accepted
Commit 187024b36c635bd454c1b1587b58c9439d3a46ad
Headers show

Commit Message

Krishna Mohan Dani Nov. 17, 2014, 1:56 p.m. UTC
Fixes the following compilation warning:
Warning: 'rt5631_i2c_dt_ids' defined but not used - when DT is not used.

Signed-off-by: Claude Youn <claude.youn@gmail.com>
Signed-off-by: Krishna Mohan Dani <krishna.md@samsung.com>
---
 sound/soc/codecs/rt5631.c |    2 ++
 1 file changed, 2 insertions(+)

Comments

Mark Brown Nov. 17, 2014, 2:52 p.m. UTC | #1
On Mon, Nov 17, 2014 at 07:26:29PM +0530, Krishna Mohan Dani wrote:
> Fixes the following compilation warning:
> Warning: 'rt5631_i2c_dt_ids' defined but not used - when DT is not used.
> 
> Signed-off-by: Claude Youn <claude.youn@gmail.com>
> Signed-off-by: Krishna Mohan Dani <krishna.md@samsung.com>

Applied, thanks.  It's really weird that such a trivial patch would have
multiple authors, if you're forwarding on a patch from someone else
please preserve their authorship as well as signoff.
Uwe Kleine-König Nov. 17, 2014, 3:56 p.m. UTC | #2
On Mon, Nov 17, 2014 at 07:26:29PM +0530, Krishna Mohan Dani wrote:
> Fixes the following compilation warning:
> Warning: 'rt5631_i2c_dt_ids' defined but not used - when DT is not used.
> 
> Signed-off-by: Claude Youn <claude.youn@gmail.com>
> Signed-off-by: Krishna Mohan Dani <krishna.md@samsung.com>
> ---
>  sound/soc/codecs/rt5631.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/sound/soc/codecs/rt5631.c b/sound/soc/codecs/rt5631.c
> index 3b7d5e4..9425545 100644
> --- a/sound/soc/codecs/rt5631.c
> +++ b/sound/soc/codecs/rt5631.c
> @@ -1691,12 +1691,14 @@ static const struct i2c_device_id rt5631_i2c_id[] = {
>  };
>  MODULE_DEVICE_TABLE(i2c, rt5631_i2c_id);
>  
> +#ifdef CONFIG_OF
>  static struct of_device_id rt5631_i2c_dt_ids[] = {
>  	{ .compatible = "realtek,rt5631"},
>  	{ .compatible = "realtek,alc5631"},
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(of, rt5631_i2c_dt_ids);
> +#endif

An (IMHO nicer) alternative is:

-static struct of_device_id rt5631_i2c_dt_ids[] = {
+static struct of_device_id rt5631_i2c_dt_ids[] __maybe_unused = {

Best regards
Uwe
Krishna Mohan Dani Nov. 24, 2014, 7:18 a.m. UTC | #3
Attaching the patch with changes suggested by Uwe. Though there is another 
patch which I submitted, but I leave it to Mark Brown as to which patch to 
pick.

Previous patch :
From 80b55f898d0a31b63fd6ed3bd82c548a0559b07b Mon Sep 17 00:00:00 2001
From: Krishna Mohan Dani <krishna.md@samsung.com>
Date: Mon, 17 Nov 2014 19:24:46 +0530
Subject: [PATCH 1/2] ASoC: rt5631: Fixing compilation warning when DT is
 disabled

-Krishna

--------------------------------------------------
From: "UweKleine-König" <u.kleine-koenig@pengutronix.de>
Sent: Monday, November 17, 2014 9:26 PM
To: "Krishna Mohan Dani" <krishna.md@samsung.com>
Cc: <linux-samsung-soc@vger.kernel.org>; 
<linux-arm-kernel@lists.infradead.org>; <alsa-devel@alsa-project.org>; 
<broonie@kernel.org>; <kgene.kim@samsung.com>; "Claude Youn" 
<claude.youn@gmail.com>
Subject: Re: [PATCH] ASoC: rt5631: Fixing compilation warning when DT is 
disabled

> On Mon, Nov 17, 2014 at 07:26:29PM +0530, Krishna Mohan Dani wrote:
>> Fixes the following compilation warning:
>> Warning: 'rt5631_i2c_dt_ids' defined but not used - when DT is not used.
>>
>> Signed-off-by: Claude Youn <claude.youn@gmail.com>
>> Signed-off-by: Krishna Mohan Dani <krishna.md@samsung.com>
>> ---
>>  sound/soc/codecs/rt5631.c |    2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/sound/soc/codecs/rt5631.c b/sound/soc/codecs/rt5631.c
>> index 3b7d5e4..9425545 100644
>> --- a/sound/soc/codecs/rt5631.c
>> +++ b/sound/soc/codecs/rt5631.c
>> @@ -1691,12 +1691,14 @@ static const struct i2c_device_id rt5631_i2c_id[] 
>> = {
>>  };
>>  MODULE_DEVICE_TABLE(i2c, rt5631_i2c_id);
>>
>> +#ifdef CONFIG_OF
>>  static struct of_device_id rt5631_i2c_dt_ids[] = {
>>  { .compatible = "realtek,rt5631"},
>>  { .compatible = "realtek,alc5631"},
>>  { }
>>  };
>>  MODULE_DEVICE_TABLE(of, rt5631_i2c_dt_ids);
>> +#endif
>
> An (IMHO nicer) alternative is:
>
> -static struct of_device_id rt5631_i2c_dt_ids[] = {
> +static struct of_device_id rt5631_i2c_dt_ids[] __maybe_unused = {
>
> Best regards
> Uwe
>
> -- 
> Pengutronix e.K.                           | Uwe Kleine-König            |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Mark Brown Nov. 24, 2014, 11:05 a.m. UTC | #4
On Mon, Nov 24, 2014 at 12:48:31PM +0530, D Krishna Mohan wrote:
> Attaching the patch with changes suggested by Uwe. Though there is another
> patch which I submitted, but I leave it to Mark Brown as to which patch to
> pick.

Please send patches in the format covered in SubmittingPatches, the
tools can't apply this.
diff mbox

Patch

diff --git a/sound/soc/codecs/rt5631.c b/sound/soc/codecs/rt5631.c
index 3b7d5e4..9425545 100644
--- a/sound/soc/codecs/rt5631.c
+++ b/sound/soc/codecs/rt5631.c
@@ -1691,12 +1691,14 @@  static const struct i2c_device_id rt5631_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, rt5631_i2c_id);
 
+#ifdef CONFIG_OF
 static struct of_device_id rt5631_i2c_dt_ids[] = {
 	{ .compatible = "realtek,rt5631"},
 	{ .compatible = "realtek,alc5631"},
 	{ }
 };
 MODULE_DEVICE_TABLE(of, rt5631_i2c_dt_ids);
+#endif
 
 static const struct regmap_config rt5631_regmap_config = {
 	.reg_bits = 8,