Skip to content

Commit

Permalink
Subject: [PATCH, RESEND] drm: exynos: avoid unused function warning
Browse files Browse the repository at this point in the history
When CONFIG_PM is not set, we get a warning about an unused function:

drivers/gpu/drm/exynos/exynos_drm_gsc.c:1219:12: error: 'gsc_clk_ctrl' defined but not used [-Werror=unused-function]
 static int gsc_clk_ctrl(struct gsc_context *ctx, bool enable)
            ^~~~~~~~~~~~

This removes the two #ifdef checks in this file and instead marks the
functions as __maybe_unused, which is a more reliable way of doing the
same, allowing better build coverage and avoiding the warning above.

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 Sep 19, 2016
1 parent b05984e commit 4158dbe
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/gpu/drm/exynos/exynos_drm_gsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1760,8 +1760,7 @@ static int gsc_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM
static int gsc_runtime_suspend(struct device *dev)
static int __maybe_unused gsc_runtime_suspend(struct device *dev)
{
struct gsc_context *ctx = get_gsc_context(dev);

Expand All @@ -1770,15 +1769,14 @@ static int gsc_runtime_suspend(struct device *dev)
return gsc_clk_ctrl(ctx, false);
}

static int gsc_runtime_resume(struct device *dev)
static int __maybe_unused gsc_runtime_resume(struct device *dev)
{
struct gsc_context *ctx = get_gsc_context(dev);

DRM_DEBUG_KMS("id[%d]\n", ctx->id);

return gsc_clk_ctrl(ctx, true);
}
#endif

static const struct dev_pm_ops gsc_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
Expand Down

0 comments on commit 4158dbe

Please sign in to comment.