summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-06-19 17:13:14 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-20 14:35:29 -0400
commit9f65627d0edaa45d914d2d180caf1b687e3c0d09 (patch)
treeed7afd33e5b87f0952c534b239b39fbd816705e4 /drivers/gpu/nvgpu/common
parent2525dc37967077554520f20c95c0a25080e3b872 (diff)
gpu: nvgpu: Pass struct gk20a to busy and resume
Pass struct gk20a pointer to gk20a_busy_noresume() and gk20a_idle_nosuspend(). This reduces the number of dependencies to Linux specific struct device. JIRA NVGPU-38 Change-Id: I5e05be32e2376bc8be5402bb973c20e28c35a1c3 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1505177 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r--drivers/gpu/nvgpu/common/linux/module.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c
index 7c7cc714..b1638b9e 100644
--- a/drivers/gpu/nvgpu/common/linux/module.c
+++ b/drivers/gpu/nvgpu/common/linux/module.c
@@ -51,9 +51,9 @@
51#define CREATE_TRACE_POINTS 51#define CREATE_TRACE_POINTS
52#include <trace/events/gk20a.h> 52#include <trace/events/gk20a.h>
53 53
54void gk20a_busy_noresume(struct device *dev) 54void gk20a_busy_noresume(struct gk20a *g)
55{ 55{
56 pm_runtime_get_noresume(dev); 56 pm_runtime_get_noresume(dev_from_gk20a(g));
57} 57}
58 58
59int gk20a_busy(struct gk20a *g) 59int gk20a_busy(struct gk20a *g)
@@ -103,9 +103,9 @@ fail:
103 return ret < 0 ? ret : 0; 103 return ret < 0 ? ret : 0;
104} 104}
105 105
106void gk20a_idle_nosuspend(struct device *dev) 106void gk20a_idle_nosuspend(struct gk20a *g)
107{ 107{
108 pm_runtime_put_noidle(dev); 108 pm_runtime_put_noidle(dev_from_gk20a(g));
109} 109}
110 110
111void gk20a_idle(struct gk20a *g) 111void gk20a_idle(struct gk20a *g)
@@ -760,7 +760,7 @@ static int gk20a_pm_suspend(struct device *dev)
760 int ret = 0; 760 int ret = 0;
761 761
762 if (g->user_railgate_disabled) 762 if (g->user_railgate_disabled)
763 gk20a_idle_nosuspend(dev); 763 gk20a_idle_nosuspend(g);
764 764
765 if (atomic_read(&dev->power.usage_count) > 1) { 765 if (atomic_read(&dev->power.usage_count) > 1) {
766 ret = -EBUSY; 766 ret = -EBUSY;
@@ -783,7 +783,7 @@ static int gk20a_pm_suspend(struct device *dev)
783 783
784fail: 784fail:
785 if (g->user_railgate_disabled) 785 if (g->user_railgate_disabled)
786 gk20a_busy_noresume(dev); 786 gk20a_busy_noresume(g);
787 787
788 return ret; 788 return ret;
789} 789}
@@ -794,7 +794,7 @@ static int gk20a_pm_resume(struct device *dev)
794 int ret = 0; 794 int ret = 0;
795 795
796 if (g->user_railgate_disabled) 796 if (g->user_railgate_disabled)
797 gk20a_busy_noresume(dev); 797 gk20a_busy_noresume(g);
798 798
799 if (!g->suspended) 799 if (!g->suspended)
800 return 0; 800 return 0;