ASoC: Disable regmap helpers if regmap is disabled
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 25 Nov 2014 20:41:03 +0000 (21:41 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 25 Nov 2014 21:15:31 +0000 (21:15 +0000)
If regmap is disabled there will be no users of the ASoC regmap helpers.
Furthermore regmap_exit() will no be defined causing the following compile
error:
sound/soc/soc-core.c: In function 'snd_soc_component_exit_regmap':
sound/soc/soc-core.c:2645:2: error: implicit declaration of function
'regmap_exit' [-Werror=implicit-function-declaration]

So disable the helpers if regmap is disabled.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Fixes: 20feb881988c ASoC: Add helper functions for deferred regmap setup")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc.h
sound/soc/soc-core.c

index 80ca937..b532348 100644 (file)
@@ -1286,6 +1286,8 @@ void snd_soc_component_async_complete(struct snd_soc_component *component);
 int snd_soc_component_test_bits(struct snd_soc_component *component,
        unsigned int reg, unsigned int mask, unsigned int value);
 
+#ifdef CONFIG_REGMAP
+
 void snd_soc_component_init_regmap(struct snd_soc_component *component,
        struct regmap *regmap);
 void snd_soc_component_exit_regmap(struct snd_soc_component *component);
@@ -1321,6 +1323,8 @@ static inline void snd_soc_codec_exit_regmap(struct snd_soc_codec *codec)
        snd_soc_component_exit_regmap(&codec->component);
 }
 
+#endif
+
 /* device driver data */
 
 static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
index db74c06..1edc519 100644 (file)
@@ -3661,6 +3661,8 @@ static void snd_soc_component_setup_regmap(struct snd_soc_component *component)
                component->val_bytes = val_bytes;
 }
 
+#ifdef CONFIG_REGMAP
+
 /**
  * snd_soc_component_init_regmap() - Initialize regmap instance for the component
  * @component: The component for which to initialize the regmap instance
@@ -3696,6 +3698,8 @@ void snd_soc_component_exit_regmap(struct snd_soc_component *component)
 }
 EXPORT_SYMBOL_GPL(snd_soc_component_exit_regmap);
 
+#endif
+
 static void snd_soc_component_add_unlocked(struct snd_soc_component *component)
 {
        if (!component->write && !component->read) {