summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/pmgr/pmgr.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-04-06 15:56:41 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-04-10 15:24:22 -0400
commit54eb74539342ce0fa6961e46f2ce22b68ad2fb21 (patch)
tree0de41f6b86a1b44f91db1361fcb68acec4056d99 /drivers/gpu/nvgpu/pmgr/pmgr.c
parentbc4a0bd0acd1d9b09f753d97383caa542cbb728a (diff)
gpu: nvgpu: pmgr: Use new error macros
gk20a_err() and gk20a_warn() require a struct device pointer, which is not portable across operating systems. The new nvgpu_err() and nvgpu_warn() macros take struct gk20a pointer. Convert code to use the more portable macros. JIRA NVGPU-16 Change-Id: I8d85e4d3da1fe8f99649ef4395a5b0dc52b0caf2 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1457353 Reviewed-by: Alex Waterman <alexw@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/pmgr/pmgr.c')
-rw-r--r--drivers/gpu/nvgpu/pmgr/pmgr.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/gpu/nvgpu/pmgr/pmgr.c b/drivers/gpu/nvgpu/pmgr/pmgr.c
index e101aba8..c41a3a22 100644
--- a/drivers/gpu/nvgpu/pmgr/pmgr.c
+++ b/drivers/gpu/nvgpu/pmgr/pmgr.c
@@ -23,8 +23,7 @@ int pmgr_pwr_devices_get_power(struct gk20a *g, u32 *val)
23 23
24 status = pmgr_pmu_pwr_devices_query_blocking(g, 1, &payload); 24 status = pmgr_pmu_pwr_devices_query_blocking(g, 1, &payload);
25 if (status) 25 if (status)
26 gk20a_err(dev_from_gk20a(g), 26 nvgpu_err(g, "pmgr_pwr_devices_get_current_power failed %x",
27 "pmgr_pwr_devices_get_current_power failed %x",
28 status); 27 status);
29 28
30 *val = payload.devices[0].powerm_w; 29 *val = payload.devices[0].powerm_w;
@@ -39,8 +38,7 @@ int pmgr_pwr_devices_get_current(struct gk20a *g, u32 *val)
39 38
40 status = pmgr_pmu_pwr_devices_query_blocking(g, 1, &payload); 39 status = pmgr_pmu_pwr_devices_query_blocking(g, 1, &payload);
41 if (status) 40 if (status)
42 gk20a_err(dev_from_gk20a(g), 41 nvgpu_err(g, "pmgr_pwr_devices_get_current failed %x",
43 "pmgr_pwr_devices_get_current failed %x",
44 status); 42 status);
45 43
46 *val = payload.devices[0].currentm_a; 44 *val = payload.devices[0].currentm_a;
@@ -55,8 +53,7 @@ int pmgr_pwr_devices_get_voltage(struct gk20a *g, u32 *val)
55 53
56 status = pmgr_pmu_pwr_devices_query_blocking(g, 1, &payload); 54 status = pmgr_pmu_pwr_devices_query_blocking(g, 1, &payload);
57 if (status) 55 if (status)
58 gk20a_err(dev_from_gk20a(g), 56 nvgpu_err(g, "pmgr_pwr_devices_get_current_voltage failed %x",
59 "pmgr_pwr_devices_get_current_voltage failed %x",
60 status); 57 status);
61 58
62 *val = payload.devices[0].voltageu_v; 59 *val = payload.devices[0].voltageu_v;
@@ -117,20 +114,17 @@ static void pmgr_debugfs_init(struct gk20a *g) {
117 dbgentry = debugfs_create_file( 114 dbgentry = debugfs_create_file(
118 "power", S_IRUGO, platform->debugfs, g, &pmgr_power_ctrl_fops); 115 "power", S_IRUGO, platform->debugfs, g, &pmgr_power_ctrl_fops);
119 if (!dbgentry) 116 if (!dbgentry)
120 gk20a_err(dev_from_gk20a(g), 117 nvgpu_err(g, "debugfs entry create failed for power");
121 "debugfs entry create failed for power");
122 118
123 dbgentry = debugfs_create_file( 119 dbgentry = debugfs_create_file(
124 "current", S_IRUGO, platform->debugfs, g, &pmgr_current_ctrl_fops); 120 "current", S_IRUGO, platform->debugfs, g, &pmgr_current_ctrl_fops);
125 if (!dbgentry) 121 if (!dbgentry)
126 gk20a_err(dev_from_gk20a(g), 122 nvgpu_err(g, "debugfs entry create failed for current");
127 "debugfs entry create failed for current");
128 123
129 dbgentry = debugfs_create_file( 124 dbgentry = debugfs_create_file(
130 "voltage", S_IRUGO, platform->debugfs, g, &pmgr_voltage_ctrl_fops); 125 "voltage", S_IRUGO, platform->debugfs, g, &pmgr_voltage_ctrl_fops);
131 if (!dbgentry) 126 if (!dbgentry)
132 gk20a_err(dev_from_gk20a(g), 127 nvgpu_err(g, "debugfs entry create failed for voltage");
133 "debugfs entry create failed for voltage");
134} 128}
135#endif 129#endif
136 130
@@ -140,7 +134,7 @@ u32 pmgr_domain_sw_setup(struct gk20a *g)
140 134
141 status = pmgr_device_sw_setup(g); 135 status = pmgr_device_sw_setup(g);
142 if (status) { 136 if (status) {
143 gk20a_err(dev_from_gk20a(g), 137 nvgpu_err(g,
144 "error creating boardobjgrp for pmgr devices, status - 0x%x", 138 "error creating boardobjgrp for pmgr devices, status - 0x%x",
145 status); 139 status);
146 goto exit; 140 goto exit;
@@ -148,7 +142,7 @@ u32 pmgr_domain_sw_setup(struct gk20a *g)
148 142
149 status = pmgr_monitor_sw_setup(g); 143 status = pmgr_monitor_sw_setup(g);
150 if (status) { 144 if (status) {
151 gk20a_err(dev_from_gk20a(g), 145 nvgpu_err(g,
152 "error creating boardobjgrp for pmgr monitor, status - 0x%x", 146 "error creating boardobjgrp for pmgr monitor, status - 0x%x",
153 status); 147 status);
154 goto exit; 148 goto exit;
@@ -156,7 +150,7 @@ u32 pmgr_domain_sw_setup(struct gk20a *g)
156 150
157 status = pmgr_policy_sw_setup(g); 151 status = pmgr_policy_sw_setup(g);
158 if (status) { 152 if (status) {
159 gk20a_err(dev_from_gk20a(g), 153 nvgpu_err(g,
160 "error creating boardobjgrp for pmgr policy, status - 0x%x", 154 "error creating boardobjgrp for pmgr policy, status - 0x%x",
161 status); 155 status);
162 goto exit; 156 goto exit;