diff mbox series

ASoC: dwc: i2s: Fix unused functions

Message ID 20230828113537.27600-1-tiwai@suse.de (mailing list archive)
State Accepted
Commit 8d2a0cdf52299d1f83a7707c5ca6b0c811339aba
Headers show
Series ASoC: dwc: i2s: Fix unused functions | expand

Commit Message

Takashi Iwai Aug. 28, 2023, 11:35 a.m. UTC
A few newly added functions aren't built unless CONFIG_OF is set,
which result in the build failure due to defined-but-not-used errors.

Put "#ifdef CONFIG_OF" around those functions to suppress the build
error.

Fixes: 52ea7c0543f8 ("ASoC: dwc: i2s: Add StarFive JH7110 SoC support")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/dwc/dwc-i2s.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Mark Brown Aug. 28, 2023, 2:50 p.m. UTC | #1
On Mon, Aug 28, 2023 at 01:35:37PM +0200, Takashi Iwai wrote:
> A few newly added functions aren't built unless CONFIG_OF is set,
> which result in the build failure due to defined-but-not-used errors.
> 
> Put "#ifdef CONFIG_OF" around those functions to suppress the build
> error.

Acked-by: Mark Brown <broonie@kernel.org>
diff mbox series

Patch

diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c
index 5ab1b3eb2d28..22c004179214 100644
--- a/sound/soc/dwc/dwc-i2s.c
+++ b/sound/soc/dwc/dwc-i2s.c
@@ -729,6 +729,7 @@  static int dw_configure_dai_by_dt(struct dw_i2s_dev *dev,
 
 }
 
+#ifdef CONFIG_OF
 /* clocks initialization with master mode on JH7110 SoC */
 static int jh7110_i2s_crg_master_init(struct dw_i2s_dev *dev)
 {
@@ -912,6 +913,7 @@  static int jh7110_i2stx0_clk_cfg(struct i2s_clk_config_data *config)
 
 	return clk_set_rate(dev->clk, bclk_rate);
 }
+#endif /* CONFIG_OF */
 
 static int dw_i2s_probe(struct platform_device *pdev)
 {