All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, Oder Chiou <oder_chiou@realtek.com>,
	broonie@kernel.org,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	kbuild test robot <lkp@intel.com>
Subject: [PATCH 2/3] ASoC: rt5682: fix compilation issues without I2C
Date: Tue, 10 Mar 2020 11:35:08 -0500	[thread overview]
Message-ID: <20200310163509.14466-3-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20200310163509.14466-1-pierre-louis.bossart@linux.intel.com>

Exclude all I2C-related code from compilation to avoid compilation
errors and defined but not used warnings.

sound/soc/codecs/rt5682.c:3688:26: warning: 'rt5682_i2c_driver'
defined but not used [-Wunused-variable]
    static struct i2c_driver rt5682_i2c_driver = {
                             ^~~~~~~~~~~~~~~~~

Reported-by: kbuild test robot <lkp@intel.com>
Fixes: 03f6fc6de9192f ('ASoC: rt5682: Add the soundwire support')
Cc: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/codecs/rt5682.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
index e1df2d076533..8828ed5db58d 100644
--- a/sound/soc/codecs/rt5682.c
+++ b/sound/soc/codecs/rt5682.c
@@ -33,6 +33,7 @@
 #include "rt5682.h"
 #include "rt5682-sdw.h"
 
+#if IS_ENABLED(CONFIG_I2C)
 static const char *rt5682_supply_names[RT5682_NUM_SUPPLIES] = {
 	"AVDD",
 	"MICVDD",
@@ -47,6 +48,7 @@ static const struct rt5682_platform_data i2s_default_platform_data = {
 	.dai_clk_names[RT5682_DAI_WCLK_IDX] = "rt5682-dai-wclk",
 	.dai_clk_names[RT5682_DAI_BCLK_IDX] = "rt5682-dai-bclk",
 };
+#endif
 
 static const struct reg_sequence patch_list[] = {
 	{RT5682_HP_IMP_SENS_CTRL_19, 0x1000},
@@ -974,6 +976,7 @@ static int rt5682_headset_detect(struct snd_soc_component *component,
 	return rt5682->jack_type;
 }
 
+#if IS_ENABLED(CONFIG_I2C)
 static irqreturn_t rt5682_irq(int irq, void *data)
 {
 	struct rt5682_priv *rt5682 = data;
@@ -1002,6 +1005,7 @@ static void rt5682_jd_check_handler(struct work_struct *work)
 		schedule_delayed_work(&rt5682->jd_check_work, 500);
 	}
 }
+#endif
 
 static int rt5682_set_jack_detect(struct snd_soc_component *component,
 	struct snd_soc_jack *hs_jack, void *data)
@@ -3214,6 +3218,7 @@ static const struct regmap_config rt5682_regmap = {
 	.use_single_write = true,
 };
 
+#if IS_ENABLED(CONFIG_I2C)
 static const struct i2c_device_id rt5682_i2c_id[] = {
 	{"rt5682", 0},
 	{}
@@ -3244,6 +3249,7 @@ static int rt5682_parse_dt(struct rt5682_priv *rt5682, struct device *dev)
 
 	return 0;
 }
+#endif
 
 static void rt5682_calibrate(struct rt5682_priv *rt5682)
 {
@@ -3510,6 +3516,7 @@ int rt5682_io_init(struct device *dev, struct sdw_slave *slave)
 EXPORT_SYMBOL_GPL(rt5682_io_init);
 #endif
 
+#if IS_ENABLED(CONFIG_I2C)
 static int rt5682_i2c_probe(struct i2c_client *i2c,
 		    const struct i2c_device_id *id)
 {
@@ -3668,6 +3675,7 @@ static void rt5682_i2c_shutdown(struct i2c_client *client)
 
 	rt5682_reset(rt5682);
 }
+#endif
 
 #ifdef CONFIG_OF
 static const struct of_device_id rt5682_of_match[] = {
@@ -3685,6 +3693,7 @@ static const struct acpi_device_id rt5682_acpi_match[] = {
 MODULE_DEVICE_TABLE(acpi, rt5682_acpi_match);
 #endif
 
+#if IS_ENABLED(CONFIG_I2C)
 static struct i2c_driver rt5682_i2c_driver = {
 	.driver = {
 		.name = "rt5682",
@@ -3696,6 +3705,7 @@ static struct i2c_driver rt5682_i2c_driver = {
 	.id_table = rt5682_i2c_id,
 };
 module_i2c_driver(rt5682_i2c_driver);
+#endif
 
 MODULE_DESCRIPTION("ASoC RT5682 driver");
 MODULE_AUTHOR("Bard Liao <bardliao@realtek.com>");
-- 
2.20.1


  parent reply	other threads:[~2020-03-10 16:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-10 16:35 [PATCH 0/3] ASoC: rt5682: fix Kconfig/compilation issues when I2C is not selected Pierre-Louis Bossart
2020-03-10 16:35 ` [PATCH 1/3] ASoC: rt5682: fix unmet dependencies Pierre-Louis Bossart
2020-03-10 18:19   ` Applied "ASoC: rt5682: fix unmet dependencies" to the asoc tree Mark Brown
2020-03-10 16:35 ` Pierre-Louis Bossart [this message]
2020-03-10 17:19   ` [PATCH 2/3] ASoC: rt5682: fix compilation issues without I2C Mark Brown
2020-03-10 18:50     ` Pierre-Louis Bossart
2020-03-10 16:35 ` [PATCH 3/3] ASoC: rt5682-sdw: fix 'defined but not used' pm functions Pierre-Louis Bossart
2020-03-10 18:19   ` Applied "ASoC: rt5682-sdw: fix 'defined but not used' pm functions" 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20200310163509.14466-3-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lkp@intel.com \
    --cc=oder_chiou@realtek.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.