Skip to content

Commit

Permalink
drm: exynos: mark pm functions as __maybe_unused
Browse files Browse the repository at this point in the history
The rework of the exynos DRM clock handling introduced
warnings for configurations that have CONFIG_PM disabled:

drivers/gpu/drm/exynos/exynos_hdmi.c:736:13: error: 'hdmi_clk_disable_gates' defined but not used [-Werror=unused-function]
 static void hdmi_clk_disable_gates(struct hdmi_context *hdata)
             ^~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/exynos/exynos_hdmi.c:717:12: error: 'hdmi_clk_enable_gates' defined but not used [-Werror=unused-function]
 static int hdmi_clk_enable_gates(struct hdmi_context *hdata)

The problem is that the PM functions themselves are inside of
an #ifdef, but some functions they call are not.

This patch removes the #ifdef and instead marks the PM functions
as __maybe_unused, which is a more reliable way to get it right.

Link: https://patchwork.kernel.org/patch/8436281/
Fixes: 9be7e98 ("drm/exynos/hdmi: clock code re-factoring")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
  • Loading branch information
Arnd Bergmann authored and Inki Dae committed Jul 27, 2017
1 parent 8f4e01f commit 7e17510
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/gpu/drm/exynos/exynos_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1932,8 +1932,7 @@ static int hdmi_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM
static int exynos_hdmi_suspend(struct device *dev)
static int __maybe_unused exynos_hdmi_suspend(struct device *dev)
{
struct hdmi_context *hdata = dev_get_drvdata(dev);

Expand All @@ -1942,7 +1941,7 @@ static int exynos_hdmi_suspend(struct device *dev)
return 0;
}

static int exynos_hdmi_resume(struct device *dev)
static int __maybe_unused exynos_hdmi_resume(struct device *dev)
{
struct hdmi_context *hdata = dev_get_drvdata(dev);
int ret;
Expand All @@ -1953,7 +1952,6 @@ static int exynos_hdmi_resume(struct device *dev)

return 0;
}
#endif

static const struct dev_pm_ops exynos_hdmi_pm_ops = {
SET_RUNTIME_PM_OPS(exynos_hdmi_suspend, exynos_hdmi_resume, NULL)
Expand Down

0 comments on commit 7e17510

Please sign in to comment.