Skip to content

Commit b427ac4

Browse files
dhananjay-AMDsuperm1
authored andcommitted
cpufreq/amd-pstate: Remove the redundant amd_pstate_set_driver() call
amd_pstate_set_driver() is called twice, once in amd_pstate_init() and once as part of amd_pstate_register_driver(). Move around code and eliminate the redundancy. 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 162cfa4 commit b427ac4

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,9 +1848,11 @@ static int __init amd_pstate_init(void)
18481848
return -ENODEV;
18491849
}
18501850

1851-
ret = amd_pstate_set_driver(cppc_state);
1852-
if (ret)
1851+
ret = amd_pstate_register_driver(cppc_state);
1852+
if (ret) {
1853+
pr_err("failed to register with return %d\n", ret);
18531854
return ret;
1855+
}
18541856

18551857
/* capability check */
18561858
if (cpu_feature_enabled(X86_FEATURE_CPPC)) {
@@ -1870,12 +1872,6 @@ static int __init amd_pstate_init(void)
18701872
return ret;
18711873
}
18721874

1873-
ret = amd_pstate_register_driver(cppc_state);
1874-
if (ret) {
1875-
pr_err("failed to register with return %d\n", ret);
1876-
return ret;
1877-
}
1878-
18791875
dev_root = bus_get_dev_root(&cpu_subsys);
18801876
if (dev_root) {
18811877
ret = sysfs_create_group(&dev_root->kobj, &amd_pstate_global_attr_group);

0 commit comments

Comments
 (0)