From 54eb74539342ce0fa6961e46f2ce22b68ad2fb21 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 6 Apr 2017 12:56:41 -0700 Subject: 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 Reviewed-on: http://git-master/r/1457353 Reviewed-by: Alex Waterman --- drivers/gpu/nvgpu/pmgr/pmgr.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'drivers/gpu/nvgpu/pmgr/pmgr.c') 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) status = pmgr_pmu_pwr_devices_query_blocking(g, 1, &payload); if (status) - gk20a_err(dev_from_gk20a(g), - "pmgr_pwr_devices_get_current_power failed %x", + nvgpu_err(g, "pmgr_pwr_devices_get_current_power failed %x", status); *val = payload.devices[0].powerm_w; @@ -39,8 +38,7 @@ int pmgr_pwr_devices_get_current(struct gk20a *g, u32 *val) status = pmgr_pmu_pwr_devices_query_blocking(g, 1, &payload); if (status) - gk20a_err(dev_from_gk20a(g), - "pmgr_pwr_devices_get_current failed %x", + nvgpu_err(g, "pmgr_pwr_devices_get_current failed %x", status); *val = payload.devices[0].currentm_a; @@ -55,8 +53,7 @@ int pmgr_pwr_devices_get_voltage(struct gk20a *g, u32 *val) status = pmgr_pmu_pwr_devices_query_blocking(g, 1, &payload); if (status) - gk20a_err(dev_from_gk20a(g), - "pmgr_pwr_devices_get_current_voltage failed %x", + nvgpu_err(g, "pmgr_pwr_devices_get_current_voltage failed %x", status); *val = payload.devices[0].voltageu_v; @@ -117,20 +114,17 @@ static void pmgr_debugfs_init(struct gk20a *g) { dbgentry = debugfs_create_file( "power", S_IRUGO, platform->debugfs, g, &pmgr_power_ctrl_fops); if (!dbgentry) - gk20a_err(dev_from_gk20a(g), - "debugfs entry create failed for power"); + nvgpu_err(g, "debugfs entry create failed for power"); dbgentry = debugfs_create_file( "current", S_IRUGO, platform->debugfs, g, &pmgr_current_ctrl_fops); if (!dbgentry) - gk20a_err(dev_from_gk20a(g), - "debugfs entry create failed for current"); + nvgpu_err(g, "debugfs entry create failed for current"); dbgentry = debugfs_create_file( "voltage", S_IRUGO, platform->debugfs, g, &pmgr_voltage_ctrl_fops); if (!dbgentry) - gk20a_err(dev_from_gk20a(g), - "debugfs entry create failed for voltage"); + nvgpu_err(g, "debugfs entry create failed for voltage"); } #endif @@ -140,7 +134,7 @@ u32 pmgr_domain_sw_setup(struct gk20a *g) status = pmgr_device_sw_setup(g); if (status) { - gk20a_err(dev_from_gk20a(g), + nvgpu_err(g, "error creating boardobjgrp for pmgr devices, status - 0x%x", status); goto exit; @@ -148,7 +142,7 @@ u32 pmgr_domain_sw_setup(struct gk20a *g) status = pmgr_monitor_sw_setup(g); if (status) { - gk20a_err(dev_from_gk20a(g), + nvgpu_err(g, "error creating boardobjgrp for pmgr monitor, status - 0x%x", status); goto exit; @@ -156,7 +150,7 @@ u32 pmgr_domain_sw_setup(struct gk20a *g) status = pmgr_policy_sw_setup(g); if (status) { - gk20a_err(dev_from_gk20a(g), + nvgpu_err(g, "error creating boardobjgrp for pmgr policy, status - 0x%x", status); goto exit; -- cgit v1.2.2