Skip to content

Commit

Permalink
watchdog: imx2_wdt: Use __maybe_unused instead of #if CONFIG_PM_SLEEP
Browse files Browse the repository at this point in the history
Use __maybe_unused for power management related functions instead
of #if CONFIG_PM_SLEEP to simply the code.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/1569308828-8320-1-git-send-email-Anson.Huang@nxp.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
  • Loading branch information
Anson Huang authored and Wim Van Sebroeck committed Nov 18, 2019
1 parent 87d1846 commit ebe66de
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/watchdog/imx2_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,8 @@ static void imx2_wdt_shutdown(struct platform_device *pdev)
}
}

#ifdef CONFIG_PM_SLEEP
/* Disable watchdog if it is active or non-active but still running */
static int imx2_wdt_suspend(struct device *dev)
static int __maybe_unused imx2_wdt_suspend(struct device *dev)
{
struct watchdog_device *wdog = dev_get_drvdata(dev);
struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog);
Expand All @@ -381,7 +380,7 @@ static int imx2_wdt_suspend(struct device *dev)
}

/* Enable watchdog and configure it if necessary */
static int imx2_wdt_resume(struct device *dev)
static int __maybe_unused imx2_wdt_resume(struct device *dev)
{
struct watchdog_device *wdog = dev_get_drvdata(dev);
struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog);
Expand All @@ -406,7 +405,6 @@ static int imx2_wdt_resume(struct device *dev)

return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(imx2_wdt_pm_ops, imx2_wdt_suspend,
imx2_wdt_resume);
Expand Down

0 comments on commit ebe66de

Please sign in to comment.