diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-04-06 14:01:46 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-04-07 16:48:18 -0400 |
commit | bb72b7e2ed215b26e1d9b94534c24ab4cfa52801 (patch) | |
tree | 2a8e781838616f4640d7ef3e5c04ae7d996e0ecf /drivers/gpu/nvgpu/gm20b/clk_gm20b.c | |
parent | 85f27cec5d010d4ac0f4646f11f145d4b3a122e4 (diff) |
gpu: nvgpu: gm20b: 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: Ic27fb98e03a982e5a1cf672cb4e8f87ecea10a5b
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1457345
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/clk_gm20b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/clk_gm20b.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c index 451dd7b6..644140d8 100644 --- a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c | |||
@@ -310,7 +310,7 @@ static int clk_config_calibration_params(struct gk20a *g) | |||
310 | * (non-production config), report error, but allow to use | 310 | * (non-production config), report error, but allow to use |
311 | * boot internal calibration with default slope. | 311 | * boot internal calibration with default slope. |
312 | */ | 312 | */ |
313 | gk20a_err(dev_from_gk20a(g), "ADC coeff are not fused\n"); | 313 | nvgpu_err(g, "ADC coeff are not fused"); |
314 | return -EINVAL; | 314 | return -EINVAL; |
315 | } | 315 | } |
316 | return 0; | 316 | return 0; |
@@ -532,7 +532,7 @@ static int clk_enbale_pll_dvfs(struct gk20a *g) | |||
532 | } while (delay > 0); | 532 | } while (delay > 0); |
533 | 533 | ||
534 | if (delay <= 0) { | 534 | if (delay <= 0) { |
535 | gk20a_err(dev_from_gk20a(g), "GPCPLL calibration timeout"); | 535 | nvgpu_err(g, "GPCPLL calibration timeout"); |
536 | return -ETIMEDOUT; | 536 | return -ETIMEDOUT; |
537 | } | 537 | } |
538 | 538 | ||
@@ -564,8 +564,7 @@ static void clk_setup_slide(struct gk20a *g, u32 clk_u) | |||
564 | step_b = 0x05; | 564 | step_b = 0x05; |
565 | break; | 565 | break; |
566 | default: | 566 | default: |
567 | gk20a_err(dev_from_gk20a(g), "Unexpected reference rate %u kHz", | 567 | nvgpu_err(g, "Unexpected reference rate %u kHz", clk_u); |
568 | clk_u); | ||
569 | BUG(); | 568 | BUG(); |
570 | } | 569 | } |
571 | 570 | ||
@@ -671,7 +670,7 @@ static int clk_slide_gpc_pll(struct gk20a *g, struct pll *gpll) | |||
671 | gk20a_readl(g, trim_sys_gpcpll_ndiv_slowdown_r()); | 670 | gk20a_readl(g, trim_sys_gpcpll_ndiv_slowdown_r()); |
672 | 671 | ||
673 | if (ramp_timeout <= 0) { | 672 | if (ramp_timeout <= 0) { |
674 | gk20a_err(dev_from_gk20a(g), "gpcpll dynamic ramp timeout"); | 673 | nvgpu_err(g, "gpcpll dynamic ramp timeout"); |
675 | return -ETIMEDOUT; | 674 | return -ETIMEDOUT; |
676 | } | 675 | } |
677 | return 0; | 676 | return 0; |
@@ -1041,7 +1040,7 @@ static int clk_program_na_gpc_pll(struct gk20a *g, struct pll *gpll_new, | |||
1041 | 1040 | ||
1042 | ret = clk_program_gpc_pll(g, &gpll_safe, 1); | 1041 | ret = clk_program_gpc_pll(g, &gpll_safe, 1); |
1043 | if (ret) { | 1042 | if (ret) { |
1044 | gk20a_err(dev_from_gk20a(g), "Safe dvfs program fail\n"); | 1043 | nvgpu_err(g, "Safe dvfs program fail"); |
1045 | return ret; | 1044 | return ret; |
1046 | } | 1045 | } |
1047 | } | 1046 | } |
@@ -1154,8 +1153,7 @@ static int gm20b_init_clk_setup_sw(struct gk20a *g) | |||
1154 | #endif | 1153 | #endif |
1155 | 1154 | ||
1156 | if (IS_ERR(ref)) { | 1155 | if (IS_ERR(ref)) { |
1157 | gk20a_err(dev_from_gk20a(g), | 1156 | nvgpu_err(g, "failed to get GPCPLL reference clock"); |
1158 | "failed to get GPCPLL reference clock"); | ||
1159 | err = -EINVAL; | 1157 | err = -EINVAL; |
1160 | goto fail; | 1158 | goto fail; |
1161 | } | 1159 | } |
@@ -1163,8 +1161,7 @@ static int gm20b_init_clk_setup_sw(struct gk20a *g) | |||
1163 | clk->gpc_pll.id = GK20A_GPC_PLL; | 1161 | clk->gpc_pll.id = GK20A_GPC_PLL; |
1164 | clk->gpc_pll.clk_in = clk_get_rate(ref) / KHZ; | 1162 | clk->gpc_pll.clk_in = clk_get_rate(ref) / KHZ; |
1165 | if (clk->gpc_pll.clk_in == 0) { | 1163 | if (clk->gpc_pll.clk_in == 0) { |
1166 | gk20a_err(dev_from_gk20a(g), | 1164 | nvgpu_err(g, "GPCPLL reference clock is zero"); |
1167 | "GPCPLL reference clock is zero"); | ||
1168 | err = -EINVAL; | 1165 | err = -EINVAL; |
1169 | goto fail; | 1166 | goto fail; |
1170 | } | 1167 | } |
@@ -1327,8 +1324,7 @@ int gm20b_register_gpcclk(struct gk20a *g) { | |||
1327 | clk->hw.init = &init; | 1324 | clk->hw.init = &init; |
1328 | c = clk_register(g->dev, &clk->hw); | 1325 | c = clk_register(g->dev, &clk->hw); |
1329 | if (IS_ERR(c)) { | 1326 | if (IS_ERR(c)) { |
1330 | gk20a_err(dev_from_gk20a(g), | 1327 | nvgpu_err(g, "Failed to register GPCPLL clock"); |
1331 | "Failed to register GPCPLL clock"); | ||
1332 | return -EINVAL; | 1328 | return -EINVAL; |
1333 | } | 1329 | } |
1334 | 1330 | ||
@@ -1405,8 +1401,7 @@ static int set_pll_target(struct gk20a *g, u32 freq, u32 old_freq) | |||
1405 | /* gpc_pll.freq is changed to new value here */ | 1401 | /* gpc_pll.freq is changed to new value here */ |
1406 | if (clk_config_pll(clk, &clk->gpc_pll, &gpc_pll_params, | 1402 | if (clk_config_pll(clk, &clk->gpc_pll, &gpc_pll_params, |
1407 | &freq, true)) { | 1403 | &freq, true)) { |
1408 | gk20a_err(dev_from_gk20a(g), | 1404 | nvgpu_err(g, "failed to set pll target for %d", freq); |
1409 | "failed to set pll target for %d", freq); | ||
1410 | return -EINVAL; | 1405 | return -EINVAL; |
1411 | } | 1406 | } |
1412 | } | 1407 | } |
@@ -1442,8 +1437,7 @@ static int set_pll_freq(struct gk20a *g, int allow_slide) | |||
1442 | * Just report error but not restore PLL since dvfs could already change | 1437 | * Just report error but not restore PLL since dvfs could already change |
1443 | * voltage even when programming failed. | 1438 | * voltage even when programming failed. |
1444 | */ | 1439 | */ |
1445 | gk20a_err(dev_from_gk20a(g), "failed to set pll to %d", | 1440 | nvgpu_err(g, "failed to set pll to %d", clk->gpc_pll.freq); |
1446 | clk->gpc_pll.freq); | ||
1447 | return err; | 1441 | return err; |
1448 | } | 1442 | } |
1449 | 1443 | ||