Skip to content

Commit

Permalink
ASoC: codecs: rk3308: fix "defined but not used" warning on !OF
Browse files Browse the repository at this point in the history
Building with CONFIG_OF=n triggers:

  warning: 'rk3308_codec_of_match' defined but not used [-Wunused-const-variable=]
  warning: unused variable 'rk3308_codec_of_match' [-Wunused-const-variable]

Even though OF is needed for probing, fix by declaring as __maybe_unused to
still allow building on non-OF configurations for build testing.

Fixes: 9fdd7b4 ("arm64: defconfig: enable Rockchip RK3308 internal audio codec driver")
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Signed-off-by: Luca Ceresoli <[email protected]>
Link: https://msgid.link/r/20240403-rk3308-audio-codec-fix-warning-v2-1-816bae4c1dc5@bootlin.com
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
lucaceresoli authored and broonie committed Apr 3, 2024
1 parent 4ed0915 commit 38d5387
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/codecs/rk3308_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ static int rk3308_codec_platform_probe(struct platform_device *pdev)
return 0;
}

static const struct of_device_id rk3308_codec_of_match[] = {
static const struct of_device_id __maybe_unused rk3308_codec_of_match[] = {
{ .compatible = "rockchip,rk3308-codec", },
{},
};
Expand Down

0 comments on commit 38d5387

Please sign in to comment.