Skip to content

Commit 4983d32

Browse files
arndbbroonie
authored andcommitted
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 readability. Signed-off-by: Arnd Bergmann <[email protected]> Fixes: b50455f ("ASoC: nau8825: cross talk suppression measurement function") Signed-off-by: Mark Brown <[email protected]>
1 parent b50455f commit 4983d32

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

sound/soc/codecs/nau8825.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,8 +2216,7 @@ static int nau8825_set_bias_level(struct snd_soc_codec *codec,
22162216
return 0;
22172217
}
22182218

2219-
#ifdef CONFIG_PM
2220-
static int nau8825_suspend(struct snd_soc_codec *codec)
2219+
static int __maybe_unused nau8825_suspend(struct snd_soc_codec *codec)
22212220
{
22222221
struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec);
22232222

@@ -2229,7 +2228,7 @@ static int nau8825_suspend(struct snd_soc_codec *codec)
22292228
return 0;
22302229
}
22312230

2232-
static int nau8825_resume(struct snd_soc_codec *codec)
2231+
static int __maybe_unused nau8825_resume(struct snd_soc_codec *codec)
22332232
{
22342233
struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec);
22352234

@@ -2253,10 +2252,6 @@ static int nau8825_resume(struct snd_soc_codec *codec)
22532252

22542253
return 0;
22552254
}
2256-
#else
2257-
#define nau8825_suspend NULL
2258-
#define nau8825_resume NULL
2259-
#endif
22602255

22612256
static struct snd_soc_codec_driver nau8825_codec_driver = {
22622257
.probe = nau8825_codec_probe,

0 commit comments

Comments
 (0)