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

clk: mmp2: fix build without CONFIG_PM

pm_clk_suspend()/pm_clk_resume() are defined as NULL pointers rather than
empty inline stubs without CONFIG_PM:

drivers/clk/mmp/clk-audio.c:402:16: error: called object type 'void *' is not a function or function pointer
pm_clk_suspend(dev);
drivers/clk/mmp/clk-audio.c:411:15: error: called object type 'void *' is not a function or function pointer
pm_clk_resume(dev);

I tried redefining the helper functions, but that caused additional
problems. This is the simple solution of replacing the __maybe_unused
trick with an #ifdef.

Fixes: 725262d29139 ("clk: mmp2: Add audio clock controller driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20210103135503.3668784-1-arnd@kernel.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Arnd Bergmann and committed by
Stephen Boyd
c361c5a6 fd238309

+4 -2
+4 -2
drivers/clk/mmp/clk-audio.c
··· 392 392 return 0; 393 393 } 394 394 395 - static int __maybe_unused mmp2_audio_clk_suspend(struct device *dev) 395 + #ifdef CONFIG_PM 396 + static int mmp2_audio_clk_suspend(struct device *dev) 396 397 { 397 398 struct mmp2_audio_clk *priv = dev_get_drvdata(dev); 398 399 ··· 405 404 return 0; 406 405 } 407 406 408 - static int __maybe_unused mmp2_audio_clk_resume(struct device *dev) 407 + static int mmp2_audio_clk_resume(struct device *dev) 409 408 { 410 409 struct mmp2_audio_clk *priv = dev_get_drvdata(dev); 411 410 ··· 416 415 417 416 return 0; 418 417 } 418 + #endif 419 419 420 420 static const struct dev_pm_ops mmp2_audio_clk_pm_ops = { 421 421 SET_RUNTIME_PM_OPS(mmp2_audio_clk_suspend, mmp2_audio_clk_resume, NULL)