Skip to contentSkip to conversation

ASoC: cs4271: Fix build error without CONFIG_SPI_MASTER

PATCH Applied Takashi Iwai 4 participants 4 messages Mar 5, 2014 – Mar 6, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: cs4271: Fix build error without CONFIG_SPI_MASTER

cs4271_common_probe() is called from cs4271_i2c_probe() but defined in
CONFIG_SPI_MASTER block, thus it results in a build error when
CONFIG_SPI_MASTER=n:
sound/soc/codecs/cs4271.c:721:2: error: implicit declaration of function ‘cs4271_common_probe’ [-Werror=implicit-function-declaration]

Move the function out of #if block.

Fixes d6cf89ee07cb ('ASoC: cs4271: claim reset GPIO in bus probe function')
---
 sound/soc/codecs/cs4271.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)
sound/soc/codecs/cs4271.c +16 -16
index 96c309777208..aef4965750c7 100644
@@ -612,22 +612,6 @@ static struct snd_soc_codec_driver soc_codec_dev_cs4271 = {
 	.num_dapm_routes	= ARRAY_SIZE(cs4271_dapm_routes),
 };
 
-#if defined(CONFIG_SPI_MASTER)
-
-static const struct regmap_config cs4271_spi_regmap = {
-	.reg_bits = 16,
-	.val_bits = 8,
-	.max_register = CS4271_LASTREG,
-	.read_flag_mask = 0x21,
-	.write_flag_mask = 0x20,
-
-	.reg_defaults = cs4271_reg_defaults,
-	.num_reg_defaults = ARRAY_SIZE(cs4271_reg_defaults),
-	.cache_type = REGCACHE_RBTREE,
-
-	.volatile_reg = cs4271_volatile_reg,
-};
-
 static int cs4271_common_probe(struct device *dev,
 			       struct cs4271_private **c)
 {
@@ -658,6 +642,22 @@ static int cs4271_common_probe(struct device *dev,
 	return 0;
 }
 
+#if defined(CONFIG_SPI_MASTER)
+
+static const struct regmap_config cs4271_spi_regmap = {
+	.reg_bits = 16,
+	.val_bits = 8,
+	.max_register = CS4271_LASTREG,
+	.read_flag_mask = 0x21,
+	.write_flag_mask = 0x20,
+
+	.reg_defaults = cs4271_reg_defaults,
+	.num_reg_defaults = ARRAY_SIZE(cs4271_reg_defaults),
+	.cache_type = REGCACHE_RBTREE,
+
+	.volatile_reg = cs4271_volatile_reg,
+};
+
 static int cs4271_spi_probe(struct spi_device *spi)
 {
 	struct cs4271_private *cs4271;
Signature · 6 lines
1.9.0

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Takashi Iwai

cs4271_common_probe() is called from cs4271_i2c_probe() but defined in
CONFIG_SPI_MASTER block, thus it results in a build error when
CONFIG_SPI_MASTER=n:
sound/soc/codecs/cs4271.c:721:2: error: implicit declaration of function ‘cs4271_common_probe’ [-Werror=implicit-function-declaration]

Move the function out of #if block.

Fixes d6cf89ee07cb ('ASoC: cs4271: claim reset GPIO in bus probe function')

Thanks!

Quoted 45 lines
---
 sound/soc/codecs/cs4271.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)
sound/soc/codecs/cs4271.c +9 -16
index 96c309777208..aef4965750c7 100644
@@ -612,22 +612,6 @@ static struct snd_soc_codec_driver soc_codec_dev_cs4271 = {
 	.num_dapm_routes	= ARRAY_SIZE(cs4271_dapm_routes),
 };
 
-#if defined(CONFIG_SPI_MASTER)
-
-static const struct regmap_config cs4271_spi_regmap = {
-	.reg_bits = 16,
-	.val_bits = 8,
-	.max_register = CS4271_LASTREG,
-	.read_flag_mask = 0x21,
-	.write_flag_mask = 0x20,
-
-	.reg_defaults = cs4271_reg_defaults,
-	.num_reg_defaults = ARRAY_SIZE(cs4271_reg_defaults),
-	.cache_type = REGCACHE_RBTREE,
-
-	.volatile_reg = cs4271_volatile_reg,
-};
-
 static int cs4271_common_probe(struct device *dev,
 			       struct cs4271_private **c)
 {
@@ -658,6 +642,22 @@ static int cs4271_common_probe(struct device *dev,
 	return 0;
 }
 
+#if defined(CONFIG_SPI_MASTER)
+
+static const struct regmap_config cs4271_spi_regmap = {
+	.reg_bits = 16,
+	.val_bits = 8,
+	.max_register = CS4271_LASTREG,
+	.read_flag_mask = 0x21,
+	.write_flag_mask = 0x20,
+

sound/soc/codecs/cs4271.c static int cs4271_common_probe(struct device *dev, · line 663

Quoted 10 lines
sound/soc/codecs/cs4271.c +7 -0
+	.reg_defaults = cs4271_reg_defaults,
+	.num_reg_defaults = ARRAY_SIZE(cs4271_reg_defaults),
+	.cache_type = REGCACHE_RBTREE,
+
+	.volatile_reg = cs4271_volatile_reg,
+};
+
 static int cs4271_spi_probe(struct spi_device *spi)
 {
 	struct cs4271_private *cs4271;

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

Acked-by on v1 1/1
#2 lore raw
In reply to Takashi Iwai
Quoted 10 lines · Takashi Iwai

cs4271_common_probe() is called from cs4271_i2c_probe() but defined in
CONFIG_SPI_MASTER block, thus it results in a build error when
CONFIG_SPI_MASTER=n:
sound/soc/codecs/cs4271.c:721:2: error: implicit declaration of function ‘cs4271_common_probe’ [-Werror=implicit-function-declaration]

Move the function out of #if block.

Fixes d6cf89ee07cb ('ASoC: cs4271: claim reset GPIO in bus probe function')

---

maintainer Applied
#3 lore raw
In reply to Takashi Iwai
Quoted 4 lines · Takashi Iwai

cs4271_common_probe() is called from cs4271_i2c_probe() but defined in
CONFIG_SPI_MASTER block, thus it results in a build error when
CONFIG_SPI_MASTER=n:
sound/soc/codecs/cs4271.c:721:2: error: implicit declaration of function ‘cs4271_common_probe’ [-Werror=implicit-function-declaration]

Applied, thanks.