diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-01-20 06:46:24 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-01-21 06:26:31 -0500 |
commit | 2256b8d2ff6c8e994161ab15b6e6d0314d3174ae (patch) | |
tree | 321d25358692a1f2edde5a8f165c5bd1ddeec5e1 | |
parent | 1ca2cf8c4167c2016d9716998b4f89c4e79d1f89 (diff) |
ASoC: rt5659: avoid unused variable warning for rt5659_acpi_match
The newly added rt5659 codec driver unconditionally defines an
ACPI device match table but then uses ACPI_PTR() to remove the
only reference to it, so we get a harmless build warning:
sound/soc/codecs/rt5659.c:4200:30: warning: 'rt5659_acpi_match' defined but not used [-Wunused-variable]
static struct acpi_device_id rt5659_acpi_match[] = {
This changes both the OF match table and the ACPI match table
to follow the same style, using ACPI_PTR/of_match_ptr to
make the reference conditional, and using an #ifdef to hide
the table. This also adds the missing MODULE_DEVICE_TABLE for
the OF case and adapts the formatting to the same style.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/rt5659.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c index c166d9394c69..fb8ea05c0de1 100644 --- a/sound/soc/codecs/rt5659.c +++ b/sound/soc/codecs/rt5659.c | |||
@@ -4183,24 +4183,29 @@ void rt5659_i2c_shutdown(struct i2c_client *client) | |||
4183 | regmap_write(rt5659->regmap, RT5659_RESET, 0); | 4183 | regmap_write(rt5659->regmap, RT5659_RESET, 0); |
4184 | } | 4184 | } |
4185 | 4185 | ||
4186 | #ifdef CONFIG_OF | ||
4186 | static const struct of_device_id rt5659_of_match[] = { | 4187 | static const struct of_device_id rt5659_of_match[] = { |
4187 | { .compatible = "realtek,rt5658", }, | 4188 | { .compatible = "realtek,rt5658", }, |
4188 | { .compatible = "realtek,rt5659", }, | 4189 | { .compatible = "realtek,rt5659", }, |
4189 | {}, | 4190 | { }, |
4190 | }; | 4191 | }; |
4192 | MODULE_DEVICE_TABLE(of, rt5659_of_match); | ||
4193 | #endif | ||
4191 | 4194 | ||
4195 | #ifdef CONFIG_ACPI | ||
4192 | static struct acpi_device_id rt5659_acpi_match[] = { | 4196 | static struct acpi_device_id rt5659_acpi_match[] = { |
4193 | { "10EC5658", 0}, | 4197 | { "10EC5658", 0, }, |
4194 | { "10EC5659", 0}, | 4198 | { "10EC5659", 0, }, |
4195 | { }, | 4199 | { }, |
4196 | }; | 4200 | }; |
4197 | MODULE_DEVICE_TABLE(acpi, rt5659_acpi_match); | 4201 | MODULE_DEVICE_TABLE(acpi, rt5659_acpi_match); |
4202 | #endif | ||
4198 | 4203 | ||
4199 | struct i2c_driver rt5659_i2c_driver = { | 4204 | struct i2c_driver rt5659_i2c_driver = { |
4200 | .driver = { | 4205 | .driver = { |
4201 | .name = "rt5659", | 4206 | .name = "rt5659", |
4202 | .owner = THIS_MODULE, | 4207 | .owner = THIS_MODULE, |
4203 | .of_match_table = rt5659_of_match, | 4208 | .of_match_table = of_match_ptr(rt5659_of_match), |
4204 | .acpi_match_table = ACPI_PTR(rt5659_acpi_match), | 4209 | .acpi_match_table = ACPI_PTR(rt5659_acpi_match), |
4205 | }, | 4210 | }, |
4206 | .probe = rt5659_i2c_probe, | 4211 | .probe = rt5659_i2c_probe, |