From 2870a4bcecf93133141aee9f4d9007f0df22cfa8 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Thu, 2 Oct 2014 15:09:20 +0300 Subject: gpu: nvgpu: Add no-op stubs for vgpu Implement empty or -ENOSYS functions for vgpu if CONFIG_TEGRA_GR_VIRTUALIZATION is not enabled, and remove ifdefs around the calling code. Change-Id: Idc75c9bc486d661786bc222bd9e0380aa7766e78 Signed-off-by: Konsta Holtta Reviewed-on: http://git-master/r/552898 Reviewed-by: Aingara Paramakuru Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a.c | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 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 ae108875..b0e8b476 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -59,9 +59,7 @@ #include "gk20a_scale.h" #include "dbg_gpu_gk20a.h" #include "hal.h" -#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION #include "vgpu/vgpu.h" -#endif #define CREATE_TRACE_POINTS #include @@ -739,21 +737,17 @@ static int gk20a_init_support(struct platform_device *dev) static int gk20a_init_client(struct platform_device *dev) { struct gk20a *g = get_gk20a(dev); + struct gk20a_platform *platform = gk20a_get_platform(dev); int err; gk20a_dbg_fn(""); -#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION - { - struct gk20a_platform *platform = gk20a_get_platform(dev); - - if (platform->virtual_dev) { - err = vgpu_pm_finalize_poweron(&dev->dev); - if (err) - return err; - } + if (platform->virtual_dev) { + err = vgpu_pm_finalize_poweron(&dev->dev); + if (err) + return err; } -#endif + #ifndef CONFIG_PM_RUNTIME gk20a_pm_finalize_poweron(&dev->dev); #endif @@ -769,17 +763,15 @@ static int gk20a_init_client(struct platform_device *dev) static void gk20a_deinit_client(struct platform_device *dev) { + struct gk20a_platform *platform = gk20a_get_platform(dev); + gk20a_dbg_fn(""); -#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION - { - struct gk20a_platform *platform = gk20a_get_platform(dev); - if (platform->virtual_dev) { - vgpu_pm_prepare_poweroff(&dev->dev); - return; - } + if (platform->virtual_dev) { + vgpu_pm_prepare_poweroff(&dev->dev); + return; } -#endif + #ifndef CONFIG_PM_RUNTIME gk20a_pm_prepare_poweroff(&dev->dev); #endif @@ -1442,10 +1434,8 @@ static int gk20a_probe(struct platform_device *dev) platform_set_drvdata(dev, platform); -#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION if (platform->virtual_dev) return vgpu_probe(dev); -#endif gk20a = kzalloc(sizeof(struct gk20a), GFP_KERNEL); if (!gk20a) { @@ -1590,15 +1580,12 @@ static int gk20a_probe(struct platform_device *dev) static int __exit gk20a_remove(struct platform_device *dev) { struct gk20a *g = get_gk20a(dev); -#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION struct gk20a_platform *platform = gk20a_get_platform(dev); -#endif + gk20a_dbg_fn(""); -#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION if (platform->virtual_dev) return vgpu_remove(dev); -#endif #ifdef CONFIG_INPUT_CFBOOST if (g->boost_added) -- cgit v1.2.2