Skip to content

Commit 59564e1

Browse files
YueHaibingbroonie
authored andcommitted
ASoC: rt5682: Fix build error without CONFIG_I2C
If I2C is n but SoundWire is m, building fails: sound/soc/codecs/rt5682.c:3716:1: warning: data definition has no type or storage class module_i2c_driver(rt5682_i2c_driver); ^~~~~~~~~~~~~~~~~ sound/soc/codecs/rt5682.c:3716:1: error: type defaults to 'int' in declaration of 'module_i2c_driver' [-Werror=implicit-int] sound/soc/codecs/rt5682.c:3716:1: warning: parameter names (without types) in function declaration Guard this use #ifdef CONFIG_I2C. Fixes: 5549ea6 ("ASoC: rt5682: fix unmet dependencies") Signed-off-by: YueHaibing <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 21fca8b commit 59564e1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sound/soc/codecs/rt5682.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3703,7 +3703,7 @@ static const struct acpi_device_id rt5682_acpi_match[] = {
37033703
MODULE_DEVICE_TABLE(acpi, rt5682_acpi_match);
37043704
#endif
37053705

3706-
static struct i2c_driver rt5682_i2c_driver = {
3706+
static struct i2c_driver __maybe_unused rt5682_i2c_driver = {
37073707
.driver = {
37083708
.name = "rt5682",
37093709
.of_match_table = of_match_ptr(rt5682_of_match),
@@ -3713,7 +3713,10 @@ static struct i2c_driver rt5682_i2c_driver = {
37133713
.shutdown = rt5682_i2c_shutdown,
37143714
.id_table = rt5682_i2c_id,
37153715
};
3716+
3717+
#ifdef CONFIG_I2C
37163718
module_i2c_driver(rt5682_i2c_driver);
3719+
#endif
37173720

37183721
MODULE_DESCRIPTION("ASoC RT5682 driver");
37193722
MODULE_AUTHOR("Bard Liao <[email protected]>");

0 commit comments

Comments
 (0)