Skip to content

Commit 6f241fa

Browse files
dhananjay-AMDsuperm1
authored andcommitted
cpufreq/amd-pstate: Call amd_pstate_register() in amd_pstate_init()
Replace a similar chunk of code in amd_pstate_init() with amd_pstate_register() call. Suggested-by: Mario Limonciello <[email protected]> Signed-off-by: Dhananjay Ugwekar <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mario Limonciello <[email protected]>
1 parent 5d9a354 commit 6f241fa

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,17 +1879,10 @@ static int __init amd_pstate_init(void)
18791879
return ret;
18801880
}
18811881

1882-
/* enable amd pstate feature */
1883-
ret = amd_pstate_enable(true);
1884-
if (ret) {
1885-
pr_err("failed to enable driver mode(%d)\n", cppc_state);
1886-
return ret;
1887-
}
1888-
1889-
ret = cpufreq_register_driver(current_pstate_driver);
1882+
ret = amd_pstate_register_driver(cppc_state);
18901883
if (ret) {
18911884
pr_err("failed to register with return %d\n", ret);
1892-
goto disable_driver;
1885+
return ret;
18931886
}
18941887

18951888
dev_root = bus_get_dev_root(&cpu_subsys);
@@ -1906,7 +1899,6 @@ static int __init amd_pstate_init(void)
19061899

19071900
global_attr_free:
19081901
cpufreq_unregister_driver(current_pstate_driver);
1909-
disable_driver:
19101902
amd_pstate_enable(false);
19111903
return ret;
19121904
}

0 commit comments

Comments
 (0)