From 78e93b7e9d4b21082bd0348288ac5a5389d2fc0f Mon Sep 17 00:00:00 2001 From: Timo Alho Date: Sat, 15 Oct 2016 23:47:36 +0300 Subject: gpu: nvgpu: fix compile when CONFIG_PM=n nvgpu driver fails to compile when CONFIG_PM build option is set to 'n'. Fix this by guarding struct gk20a_pm_ops and the functions pointed by in that struct with #ifdefs. Bug 1827482 Change-Id: I27f3535e89cc741f79824cdc427ef3572e2779e6 Signed-off-by: Timo Alho Reviewed-on: http://git-master/r/1237110 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 55ebf2da..70eb0a7e 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -1369,6 +1369,7 @@ static void gk20a_pm_shutdown(struct platform_device *pdev) dev_info(&pdev->dev, "shut down complete\n"); } +#ifdef CONFIG_PM static int gk20a_pm_runtime_resume(struct device *dev) { int err = 0; @@ -1419,12 +1420,10 @@ static int gk20a_pm_suspend(struct device *dev) if (platform->user_railgate_disabled) gk20a_idle_nosuspend(dev); -#ifdef CONFIG_PM if (atomic_read(&dev->power.usage_count) > 1) { ret = -EBUSY; goto fail; } -#endif if (!g->power_on) return 0; @@ -1466,7 +1465,6 @@ static int gk20a_pm_resume(struct device *dev) return ret; } -#ifdef CONFIG_PM static const struct dev_pm_ops gk20a_pm_ops = { .runtime_resume = gk20a_pm_runtime_resume, .runtime_suspend = gk20a_pm_runtime_suspend, -- cgit v1.2.2