Skip to content

Commit bc9b1eb

Browse files
arndbbroonie
authored andcommitted
ASoC: tas2781: fix unused-const-variable warning
When both CONFIG_OF and CONFIG_ACPI are disabled, the ID table is not referenced any more: sound/soc/codecs/tas2781-i2c.c:102:35: error: 'tasdevice_id' defined but not used [-Werror=unused-const-variable=] 102 | static const struct i2c_device_id tasdevice_id[] = { | ^~~~~~~~~~~~ Remove the #ifdef checks and just include the ID tables unconditionally to get a clean build in all configurations. The code already uses IS_ENABLED() checks for both to benefit from dead code elimination and the ID tables are small enough that they can just be included all the time. Fixes: 9a52d1b ("ASoC: tas2781: Explicit association of Device, Device Name, and Device ID") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://patch.msgid.link/20260413070059.3828364-1-arnd@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 115e7d7 commit bc9b1eb

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

sound/soc/codecs/tas2781-i2c.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ static const struct i2c_device_id tasdevice_id[] = {
122122
{}
123123
};
124124

125-
#ifdef CONFIG_OF
126125
static const struct of_device_id tasdevice_of_match[] = {
127126
{ .compatible = "ti,tas2020", .data = &tasdevice_id[TAS2020] },
128127
{ .compatible = "ti,tas2118", .data = &tasdevice_id[TAS2118] },
@@ -146,7 +145,6 @@ static const struct of_device_id tasdevice_of_match[] = {
146145
{},
147146
};
148147
MODULE_DEVICE_TABLE(of, tasdevice_of_match);
149-
#endif
150148

151149
/**
152150
* tas2781_digital_getvol - get the volum control
@@ -2083,7 +2081,6 @@ static void tasdevice_i2c_remove(struct i2c_client *client)
20832081
tasdevice_remove(tas_priv);
20842082
}
20852083

2086-
#ifdef CONFIG_ACPI
20872084
static const struct acpi_device_id tasdevice_acpi_match[] = {
20882085
{ "TXNW2020", (kernel_ulong_t)&tasdevice_id[TAS2020] },
20892086
{ "TXNW2118", (kernel_ulong_t)&tasdevice_id[TAS2118] },
@@ -2108,15 +2105,12 @@ static const struct acpi_device_id tasdevice_acpi_match[] = {
21082105
};
21092106

21102107
MODULE_DEVICE_TABLE(acpi, tasdevice_acpi_match);
2111-
#endif
21122108

21132109
static struct i2c_driver tasdevice_i2c_driver = {
21142110
.driver = {
21152111
.name = "tasdev-codec",
2116-
.of_match_table = of_match_ptr(tasdevice_of_match),
2117-
#ifdef CONFIG_ACPI
2118-
.acpi_match_table = ACPI_PTR(tasdevice_acpi_match),
2119-
#endif
2112+
.of_match_table = tasdevice_of_match,
2113+
.acpi_match_table = tasdevice_acpi_match,
21202114
},
21212115
.probe = tasdevice_i2c_probe,
21222116
.remove = tasdevice_i2c_remove,

0 commit comments

Comments
 (0)