Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 9a52d1b7cb4a ("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>

authored by

Arnd Bergmann and committed by
Mark Brown
bc9b1eba 115e7d76

+2 -8
+2 -8
sound/soc/codecs/tas2781-i2c.c
··· 122 122 {} 123 123 }; 124 124 125 - #ifdef CONFIG_OF 126 125 static const struct of_device_id tasdevice_of_match[] = { 127 126 { .compatible = "ti,tas2020", .data = &tasdevice_id[TAS2020] }, 128 127 { .compatible = "ti,tas2118", .data = &tasdevice_id[TAS2118] }, ··· 145 146 {}, 146 147 }; 147 148 MODULE_DEVICE_TABLE(of, tasdevice_of_match); 148 - #endif 149 149 150 150 /** 151 151 * tas2781_digital_getvol - get the volum control ··· 2081 2083 tasdevice_remove(tas_priv); 2082 2084 } 2083 2085 2084 - #ifdef CONFIG_ACPI 2085 2086 static const struct acpi_device_id tasdevice_acpi_match[] = { 2086 2087 { "TXNW2020", (kernel_ulong_t)&tasdevice_id[TAS2020] }, 2087 2088 { "TXNW2118", (kernel_ulong_t)&tasdevice_id[TAS2118] }, ··· 2105 2108 }; 2106 2109 2107 2110 MODULE_DEVICE_TABLE(acpi, tasdevice_acpi_match); 2108 - #endif 2109 2111 2110 2112 static struct i2c_driver tasdevice_i2c_driver = { 2111 2113 .driver = { 2112 2114 .name = "tasdev-codec", 2113 - .of_match_table = of_match_ptr(tasdevice_of_match), 2114 - #ifdef CONFIG_ACPI 2115 - .acpi_match_table = ACPI_PTR(tasdevice_acpi_match), 2116 - #endif 2115 + .of_match_table = tasdevice_of_match, 2116 + .acpi_match_table = tasdevice_acpi_match, 2117 2117 }, 2118 2118 .probe = tasdevice_i2c_probe, 2119 2119 .remove = tasdevice_i2c_remove,