Commit b4eeed59 authored by Huang Rui's avatar Huang Rui Committed by Alex Deucher

drm/amd/powerplay: rewrite pp_sw_init to make code readable

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: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 67b1fcc9
...@@ -68,15 +68,18 @@ static int pp_sw_init(void *handle) ...@@ -68,15 +68,18 @@ static int pp_sw_init(void *handle)
return -EINVAL; return -EINVAL;
ret = hwmgr->pptable_func->pptable_init(hwmgr); 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) if (ret)
printk(KERN_ERR "amdgpu: powerplay initialization failed\n"); goto err;
else
printk(KERN_INFO "amdgpu: powerplay initialized\n");
pr_info("amdgpu: powerplay initialized\n");
return 0;
err:
pr_err("amdgpu: powerplay initialization failed\n");
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment