archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <>
To: Mark Brown <>
Cc: Liam Girdwood <>,,,
	John Hsu <>, Ben Zhang <>
Subject: [PATCH 2/2] ASoC: nau8825: mark pm functions __maybe_unused
Date: Tue, 14 Jun 2016 12:19:31 +0200	[thread overview]
Message-ID: <24871235.njqcnbLnL2@wuerfel> (raw)
In-Reply-To: <5926900.hCFXH4RQH6@wuerfel>

Subject: [PATCH] ASoC: nau8825: mark pm functions __maybe_unused

The newly added nau8825_dai_is_active() function is only called from
the PM logic that is build-time conditional in this driver, so we get
a warning when CONFIG_PM is disabled:

sound/soc/codecs/nau8825.c:229:13: error: 'nau8825_dai_is_active' defined but not used [-Werror=unused-function]
 static bool nau8825_dai_is_active(struct nau8825 *nau8825)

By replacing the #ifdef around the functions with a __maybe_unused
annotation, the code becomes more robust to this kind of problem
and we no longer get the warning while also slightly improving

Signed-off-by: Arnd Bergmann <>
Fixes: b50455fab459 ("ASoC: nau8825: cross talk suppression measurement function")
Like the first patch, this is for a warning that just appeared on today's

diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index 4b0a1b8d9405..3f30e6ed210c 100644
--- a/sound/soc/codecs/nau8825.c
+++ b/sound/soc/codecs/nau8825.c
@@ -2216,8 +2216,7 @@ static int nau8825_set_bias_level(struct snd_soc_codec *codec,
 	return 0;
-#ifdef CONFIG_PM
-static int nau8825_suspend(struct snd_soc_codec *codec)
+static int __maybe_unused nau8825_suspend(struct snd_soc_codec *codec)
 	struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec);
@@ -2229,7 +2228,7 @@ static int nau8825_suspend(struct snd_soc_codec *codec)
 	return 0;
-static int nau8825_resume(struct snd_soc_codec *codec)
+static int __maybe_unused nau8825_resume(struct snd_soc_codec *codec)
 	struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec);
@@ -2253,10 +2252,6 @@ static int nau8825_resume(struct snd_soc_codec *codec)
 	return 0;
-#define nau8825_suspend NULL
-#define nau8825_resume NULL
 static struct snd_soc_codec_driver nau8825_codec_driver = {
 	.probe = nau8825_codec_probe,

  reply	other threads:[~2016-06-14 10:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-14 10:17 [PATCH 1/2] ASoC: remove one extraneous 'const' Arnd Bergmann
2016-06-14 10:19 ` Arnd Bergmann [this message]
2016-06-14 15:09   ` Applied "ASoC: nau8825: mark pm functions __maybe_unused" to the asoc tree Mark Brown
2016-06-14 12:35 ` [PATCH 1/2] ASoC: remove one extraneous 'const' Charles Keepax
2016-06-14 15:09 ` Applied "ASoC: remove one extraneous 'const'" to the asoc tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24871235.njqcnbLnL2@wuerfel \ \ \ \ \ \ \ \
    --subject='Re: [PATCH 2/2] ASoC: nau8825: mark pm functions __maybe_unused' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).