Skip to content

Commit

Permalink
rtc: meson: mark PM functions as __maybe_unused
Browse files Browse the repository at this point in the history
The meson_vrtc_set_wakeup_time() function is only used by
the PM functions and causes a warning when they are disabled:

drivers/rtc/rtc-meson-vrtc.c:32:13: error: unused function 'meson_vrtc_set_wakeup_time' [-Werror,-Wunused-function]

Remove the #ifdef around the callers and add a __maybe_unused
annotation as a more reliable way to avoid these warnings.

Signed-off-by: Arnd Bergmann <[email protected]>
Reviewed-by: Kevin Hilman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
  • Loading branch information
arndb authored and alexandrebelloni committed Sep 10, 2019
1 parent e02e3dd commit b99a312
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/rtc/rtc-meson-vrtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ static int meson_vrtc_probe(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int meson_vrtc_suspend(struct device *dev)
static int __maybe_unused meson_vrtc_suspend(struct device *dev)
{
struct meson_vrtc_data *vrtc = dev_get_drvdata(dev);

Expand Down Expand Up @@ -121,7 +120,7 @@ static int meson_vrtc_suspend(struct device *dev)
return 0;
}

static int meson_vrtc_resume(struct device *dev)
static int __maybe_unused meson_vrtc_resume(struct device *dev)
{
struct meson_vrtc_data *vrtc = dev_get_drvdata(dev);

Expand All @@ -131,7 +130,7 @@ static int meson_vrtc_resume(struct device *dev)
meson_vrtc_set_wakeup_time(vrtc, 0);
return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(meson_vrtc_pm_ops,
meson_vrtc_suspend, meson_vrtc_resume);

Expand Down

0 comments on commit b99a312

Please sign in to comment.