Skip to content

Commit c361c5a

Browse files
arndbbebarino
authored andcommitted
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: 725262d ("clk: mmp2: Add audio clock controller driver") Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent fd23830 commit c361c5a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/clk/mmp/clk-audio.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,8 @@ static int mmp2_audio_clk_remove(struct platform_device *pdev)
392392
return 0;
393393
}
394394

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)
396397
{
397398
struct mmp2_audio_clk *priv = dev_get_drvdata(dev);
398399

@@ -404,7 +405,7 @@ static int __maybe_unused mmp2_audio_clk_suspend(struct device *dev)
404405
return 0;
405406
}
406407

407-
static int __maybe_unused mmp2_audio_clk_resume(struct device *dev)
408+
static int mmp2_audio_clk_resume(struct device *dev)
408409
{
409410
struct mmp2_audio_clk *priv = dev_get_drvdata(dev);
410411

@@ -415,6 +416,7 @@ static int __maybe_unused mmp2_audio_clk_resume(struct device *dev)
415416

416417
return 0;
417418
}
419+
#endif
418420

419421
static const struct dev_pm_ops mmp2_audio_clk_pm_ops = {
420422
SET_RUNTIME_PM_OPS(mmp2_audio_clk_suspend, mmp2_audio_clk_resume, NULL)

0 commit comments

Comments
 (0)