Commit 6f241fa5 authored by Dhananjay Ugwekar's avatar Dhananjay Ugwekar Committed by Mario Limonciello
Browse files

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: default avatarMario Limonciello <mario.limonciello@amd.com>
Signed-off-by: default avatarDhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
Reviewed-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20241017100528.300143-2-Dhananjay.Ugwekar@amd.com


Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
parent 5d9a354c
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -1879,17 +1879,10 @@ static int __init amd_pstate_init(void)
			return ret;
	}

	/* enable amd pstate feature */
	ret = amd_pstate_enable(true);
	if (ret) {
		pr_err("failed to enable driver mode(%d)\n", cppc_state);
		return ret;
	}

	ret = cpufreq_register_driver(current_pstate_driver);
	ret = amd_pstate_register_driver(cppc_state);
	if (ret) {
		pr_err("failed to register with return %d\n", ret);
		goto disable_driver;
		return ret;
	}

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

global_attr_free:
	cpufreq_unregister_driver(current_pstate_driver);
disable_driver:
	amd_pstate_enable(false);
	return ret;
}