cpufreq: amd-pstate: Don't create attributes when registration fails
authorMario Limonciello <mario.limonciello@amd.com>
Sun, 23 Jun 2024 20:09:18 +0000 (15:09 -0500)
committerMario Limonciello <mario.limonciello@amd.com>
Mon, 24 Jun 2024 18:17:56 +0000 (13:17 -0500)
commitbc76f57574741cc8e7d04c53f199d8722ce09413
tree3cd4f901b127f53795acb5791487c5a652651211
parente1a921f7fcd157ca898e453bbb56927ab39412e3
cpufreq: amd-pstate: Don't create attributes when registration fails

If driver registration fails then immediately return the failure
instead of continuing to register attributes.

This fixes issues of falling back from amd-pstate to other drivers
when cpufreq init has failed for any reason.

Reported-by: alex.s.cochran@proton.me
Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
Reviewed-by: Perry Yuan <Perry.Yuan@amd.com>
Link: https://lore.kernel.org/r/20240623200918.52104-1-mario.limonciello@amd.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
drivers/cpufreq/amd-pstate.c