From 1add126551309a323ae422be41c9db2203bbe112 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 6 Apr 2017 12:17:26 -0700 Subject: gpu: nvgpu: clk: 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: I58bb9e2fb7e5b18f74fbb92b70150cce97968fc3 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1457347 Reviewed-by: Alex Waterman --- drivers/gpu/nvgpu/clk/clk_mclk.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'drivers/gpu/nvgpu/clk/clk_mclk.c') diff --git a/drivers/gpu/nvgpu/clk/clk_mclk.c b/drivers/gpu/nvgpu/clk/clk_mclk.c index f973a696..690f8681 100644 --- a/drivers/gpu/nvgpu/clk/clk_mclk.c +++ b/drivers/gpu/nvgpu/clk/clk_mclk.c @@ -1979,7 +1979,7 @@ static void mclk_seq_pmucmdhandler(struct gk20a *g, struct pmu_msg *_msg, gk20a_dbg_info(""); if (status != 0) { - gk20a_err(dev_from_gk20a(g), "mclk seq_script cmd aborted"); + nvgpu_err(g, "mclk seq_script cmd aborted"); msg_status = -ENOENT; goto status_update; } @@ -2088,8 +2088,7 @@ static int mclk_get_memclk_table(struct gk20a *g) } if (shadow_idx > fb_fbpa_fbio_delay_priv_max_v()) { - gk20a_err(dev_from_gk20a(g), - "invalid shadow reg script index"); + nvgpu_err(g, "invalid shadow reg script index"); status = -EINVAL; goto done; } @@ -2140,8 +2139,8 @@ static int mclk_get_memclk_table(struct gk20a *g) } if (cmd_idx > fb_fbpa_fbio_cmd_delay_cmd_priv_max_v()) { - gk20a_err(dev_from_gk20a(g), - "invalid shadow reg cmd script index"); + nvgpu_err(g, + "invalid shadow reg cmd script index"); status = -EINVAL; goto done; } @@ -2236,8 +2235,7 @@ int clk_mclkseq_init_mclk_gddr5(struct gk20a *g) mclk->vreg_buf = nvgpu_kcalloc(g, VREG_COUNT, sizeof(u32)); if (!mclk->vreg_buf) { - gk20a_err(dev_from_gk20a(g), - "unable to allocate memory for VREG"); + nvgpu_err(g, "unable to allocate memory for VREG"); err = -ENOMEM; goto fail_data_mutex; } @@ -2318,8 +2316,7 @@ int clk_mclkseq_change_mclk_gddr5(struct gk20a *g, u16 val) } break; default: - gk20a_err(dev_from_gk20a(g), - "Illegal MCLK clock change"); + nvgpu_err(g, "Illegal MCLK clock change"); status = -EINVAL; goto exit_status; } @@ -2368,8 +2365,7 @@ int clk_mclkseq_change_mclk_gddr5(struct gk20a *g, u16 val) mclk_seq_pmucmdhandler, &seq_completion_status, &seqdesc, ~0); if (status) { - gk20a_err(dev_from_gk20a(g), - "unable to post seq script exec cmd for unit %x ", + nvgpu_err(g, "unable to post seq script exec cmd for unit %x", cmd.hdr.unit_id); goto exit_status; } @@ -2377,8 +2373,7 @@ int clk_mclkseq_change_mclk_gddr5(struct gk20a *g, u16 val) pmu_wait_message_cond(&g->pmu, (gk20a_get_gr_idle_timeout(g)), &seq_completion_status, 0); if (seq_completion_status != 0) { - gk20a_err(dev_from_gk20a(g), - "seq_script update failed"); + nvgpu_err(g, "seq_script update failed"); status = -EBUSY; goto exit_status; } -- cgit v1.2.2