Re: sound/soc/codecs/lochnagar-sc.c:247:34: warning: unused variable 'lochnagar_of_match'

From: Arnd Bergmann
Date: Mon Oct 10 2022 - 05:57:45 EST


On Mon, Oct 10, 2022, at 10:45 AM, kernel test robot wrote:
>
> tree:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> master
> head: 493ffd6605b2d3d4dc7008ab927dba319f36671f
> commit: 5b7f4e5de61ba8c44317718936864da29eeba62a ASoC: codecs: allow
> compile testing without MFD drivers
>
>>> sound/soc/codecs/lochnagar-sc.c:247:34: warning: unused variable 'lochnagar_of_match' [-Wunused-const-variable]
> static const struct of_device_id lochnagar_of_match[] = {

The 'of_match_ptr()' macro usage should be removed here, since
the array is defined unconditionally:

--- a/sound/soc/codecs/lochnagar-sc.c
+++ b/sound/soc/codecs/lochnagar-sc.c
@@ -253,7 +253,7 @@ MODULE_DEVICE_TABLE(of, lochnagar_of_match);
static struct platform_driver lochnagar_sc_codec_driver = {
.driver = {
.name = "lochnagar-soundcard",
- .of_match_table = of_match_ptr(lochnagar_of_match),
+ .of_match_table = lochnagar_of_match,
},

.probe = lochnagar_sc_probe,



Arnd