Skip to content

Commit

Permalink
drm/amd/powerplay: rewrite pp_sw_init to make code readable
Browse files Browse the repository at this point in the history
Actually, pp_sw_init executes pptable_init and backend_init orderly if
they are initialized successfully. So rewrite it to make code more
readable.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Huang Rui authored and Alex Deucher committed May 11, 2016
1 parent 67b1fcc commit b4eeed5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions drivers/gpu/drm/amd/powerplay/amd_powerplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,18 @@ static int pp_sw_init(void *handle)
return -EINVAL;

ret = hwmgr->pptable_func->pptable_init(hwmgr);
if (ret)
goto err;

if (ret == 0)
ret = hwmgr->hwmgr_func->backend_init(hwmgr);

ret = hwmgr->hwmgr_func->backend_init(hwmgr);
if (ret)
printk(KERN_ERR "amdgpu: powerplay initialization failed\n");
else
printk(KERN_INFO "amdgpu: powerplay initialized\n");
goto err;

pr_info("amdgpu: powerplay initialized\n");

return 0;
err:
pr_err("amdgpu: powerplay initialization failed\n");
return ret;
}

Expand Down

0 comments on commit b4eeed5

Please sign in to comment.