linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ASoC: cs4341: fix waring unused-function
@ 2019-01-14  9:55 Anders Roxell
  2019-01-14 11:24 ` Mark Brown
  2019-01-14 23:04 ` Applied "ASoC: cs4341: fix waring unused-function" to the asoc tree Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Anders Roxell @ 2019-01-14  9:55 UTC (permalink / raw)
  To: perex, tiwai, brian.austin, Paul.Handrigan, lgirdwood, broonie
  Cc: alsa-devel, linux-kernel, Anders Roxell

The driver cs4341 can be built with SPI and/or I2C, but it has to be one
of them at least. When I2C is set as a module we see the warning below:

sound/soc/codecs/cs4341.c:213:12: warning: ‘cs4341_probe’
defined but not used [-Wunused-function]
 static int cs4341_probe(struct device *dev)
            ^~~~~~~~~~~~

Rework so that we use IS_ENABLED instead of defined. Also change so
SND_SOC_CS4341 depends on SND_SOC_I2C_AND_SPI to we dont' get a link
error when SND_SOC_CS4341=y, I2C=m and REGMAP_I2C=m is set.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 sound/soc/codecs/Kconfig  | 2 +-
 sound/soc/codecs/cs4341.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 87cb9c51e6f5..87ecb38e57f4 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -546,7 +546,7 @@ config SND_SOC_CS43130
 
 config SND_SOC_CS4341
 	tristate "Cirrus Logic CS4341 CODEC"
-	depends on I2C || SPI_MASTER
+	depends on SND_SOC_I2C_AND_SPI
 	select REGMAP_I2C if I2C
 	select REGMAP_SPI if SPI_MASTER
 
diff --git a/sound/soc/codecs/cs4341.c b/sound/soc/codecs/cs4341.c
index d2e616a89fd4..ade7477d04f1 100644
--- a/sound/soc/codecs/cs4341.c
+++ b/sound/soc/codecs/cs4341.c
@@ -223,7 +223,7 @@ static int cs4341_probe(struct device *dev)
 					       &cs4341_dai, 1);
 }
 
-#if defined(CONFIG_I2C)
+#if IS_ENABLED(CONFIG_I2C)
 static int cs4341_i2c_probe(struct i2c_client *i2c,
 			    const struct i2c_device_id *id)
 {
@@ -317,7 +317,7 @@ static int __init cs4341_init(void)
 {
 	int ret = 0;
 
-#if defined(CONFIG_I2C)
+#if IS_ENABLED(CONFIG_I2C)
 	ret = i2c_add_driver(&cs4341_i2c_driver);
 	if (ret)
 		return ret;
@@ -332,7 +332,7 @@ module_init(cs4341_init);
 
 static void __exit cs4341_exit(void)
 {
-#if defined(CONFIG_I2C)
+#if IS_ENABLED(CONFIG_I2C)
 	i2c_del_driver(&cs4341_i2c_driver);
 #endif
 #if defined(CONFIG_SPI_MASTER)
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] ASoC: cs4341: fix waring unused-function
  2019-01-14  9:55 [PATCH 1/3] ASoC: cs4341: fix waring unused-function Anders Roxell
@ 2019-01-14 11:24 ` Mark Brown
  2019-01-14 12:49   ` Anders Roxell
  2019-01-14 23:04 ` Applied "ASoC: cs4341: fix waring unused-function" to the asoc tree Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2019-01-14 11:24 UTC (permalink / raw)
  To: Anders Roxell
  Cc: perex, tiwai, brian.austin, Paul.Handrigan, lgirdwood,
	alsa-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 321 bytes --]

On Mon, Jan 14, 2019 at 10:55:40AM +0100, Anders Roxell wrote:
> The driver cs4341 can be built with SPI and/or I2C, but it has to be one
> of them at least. When I2C is set as a module we see the warning below:

I'm missing patches 2 and 3 of this series and there's no cover letter.
What's the story with dependencies?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] ASoC: cs4341: fix waring unused-function
  2019-01-14 11:24 ` Mark Brown
@ 2019-01-14 12:49   ` Anders Roxell
  2019-01-14 14:08     ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Anders Roxell @ 2019-01-14 12:49 UTC (permalink / raw)
  To: Mark Brown
  Cc: perex, tiwai, brian.austin, Paul.Handrigan, Liam Girdwood,
	alsa-devel, Linux Kernel Mailing List

On Mon, 14 Jan 2019 at 12:24, Mark Brown <broonie@kernel.org> wrote:
>
> On Mon, Jan 14, 2019 at 10:55:40AM +0100, Anders Roxell wrote:
> > The driver cs4341 can be built with SPI and/or I2C, but it has to be one
> > of them at least. When I2C is set as a module we see the warning below:
>
> I'm missing patches 2 and 3 of this series and there's no cover letter.
> What's the story with dependencies?

oh, I made a mistake. It Should not be any dependencies, just this patch.

Do you want me to resend it without " 1/3]... " in the subject?

Cheers,
Anders

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] ASoC: cs4341: fix waring unused-function
  2019-01-14 12:49   ` Anders Roxell
@ 2019-01-14 14:08     ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2019-01-14 14:08 UTC (permalink / raw)
  To: Anders Roxell
  Cc: perex, tiwai, brian.austin, Paul.Handrigan, Liam Girdwood,
	alsa-devel, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 148 bytes --]

On Mon, Jan 14, 2019 at 01:49:17PM +0100, Anders Roxell wrote:

> Do you want me to resend it without " 1/3]... " in the subject?

No, that's fine.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Applied "ASoC: cs4341: fix waring unused-function" to the asoc tree
  2019-01-14  9:55 [PATCH 1/3] ASoC: cs4341: fix waring unused-function Anders Roxell
  2019-01-14 11:24 ` Mark Brown
@ 2019-01-14 23:04 ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2019-01-14 23:04 UTC (permalink / raw)
  To: Anders Roxell
  Cc: Mark Brown, perex, tiwai, brian.austin, Paul.Handrigan,
	lgirdwood, broonie, alsa-devel, linux-kernel, alsa-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3279 bytes --]

The patch

   ASoC: cs4341: fix waring unused-function

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 3e8c45f57a90585cfc0b07ae81de8960a8366c1c Mon Sep 17 00:00:00 2001
From: Anders Roxell <anders.roxell@linaro.org>
Date: Mon, 14 Jan 2019 10:55:40 +0100
Subject: [PATCH] ASoC: cs4341: fix waring unused-function
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The driver cs4341 can be built with SPI and/or I2C, but it has to be one
of them at least. When I2C is set as a module we see the warning below:

sound/soc/codecs/cs4341.c:213:12: warning: ‘cs4341_probe’
defined but not used [-Wunused-function]
 static int cs4341_probe(struct device *dev)
            ^~~~~~~~~~~~

Rework so that we use IS_ENABLED instead of defined. Also change so
SND_SOC_CS4341 depends on SND_SOC_I2C_AND_SPI to we dont' get a link
error when SND_SOC_CS4341=y, I2C=m and REGMAP_I2C=m is set.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/Kconfig  | 2 +-
 sound/soc/codecs/cs4341.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 87cb9c51e6f5..87ecb38e57f4 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -546,7 +546,7 @@ config SND_SOC_CS43130
 
 config SND_SOC_CS4341
 	tristate "Cirrus Logic CS4341 CODEC"
-	depends on I2C || SPI_MASTER
+	depends on SND_SOC_I2C_AND_SPI
 	select REGMAP_I2C if I2C
 	select REGMAP_SPI if SPI_MASTER
 
diff --git a/sound/soc/codecs/cs4341.c b/sound/soc/codecs/cs4341.c
index d2e616a89fd4..ade7477d04f1 100644
--- a/sound/soc/codecs/cs4341.c
+++ b/sound/soc/codecs/cs4341.c
@@ -223,7 +223,7 @@ static int cs4341_probe(struct device *dev)
 					       &cs4341_dai, 1);
 }
 
-#if defined(CONFIG_I2C)
+#if IS_ENABLED(CONFIG_I2C)
 static int cs4341_i2c_probe(struct i2c_client *i2c,
 			    const struct i2c_device_id *id)
 {
@@ -317,7 +317,7 @@ static int __init cs4341_init(void)
 {
 	int ret = 0;
 
-#if defined(CONFIG_I2C)
+#if IS_ENABLED(CONFIG_I2C)
 	ret = i2c_add_driver(&cs4341_i2c_driver);
 	if (ret)
 		return ret;
@@ -332,7 +332,7 @@ module_init(cs4341_init);
 
 static void __exit cs4341_exit(void)
 {
-#if defined(CONFIG_I2C)
+#if IS_ENABLED(CONFIG_I2C)
 	i2c_del_driver(&cs4341_i2c_driver);
 #endif
 #if defined(CONFIG_SPI_MASTER)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-01-14 23:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-14  9:55 [PATCH 1/3] ASoC: cs4341: fix waring unused-function Anders Roxell
2019-01-14 11:24 ` Mark Brown
2019-01-14 12:49   ` Anders Roxell
2019-01-14 14:08     ` Mark Brown
2019-01-14 23:04 ` Applied "ASoC: cs4341: fix waring unused-function" to the asoc tree Mark Brown

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).