[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220325054228.5247-2-mario.limonciello@amd.com>
Date: Fri, 25 Mar 2022 00:42:26 -0500
From: Mario Limonciello <mario.limonciello@....com>
To: Huang Rui <ray.huang@....com>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Viresh Kumar <viresh.kumar@...aro.org>
CC: "open list:AMD PSTATE DRIVER" <linux-pm@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>,
Mario Limonciello <mario.limonciello@....com>
Subject: [PATCH 1/3] cpufreq: Allow passing NULL as the argument for unregistering a driver
Currently the arguments passed to `cpufreq_unregister_driver` are matched
against the currently registered driver.
This means that the only way for a driver to be unregistered is if it's
module is unloaded. Loosen that restriction to allow other kernel modules
to unregister a registered driver.
Signed-off-by: Mario Limonciello <mario.limonciello@....com>
---
drivers/cpufreq/cpufreq.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 80f535cc8a75..4711c17a89bb 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2885,10 +2885,10 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver)
{
unsigned long flags;
- if (!cpufreq_driver || (driver != cpufreq_driver))
+ if (!cpufreq_driver)
return -EINVAL;
- pr_debug("unregistering driver %s\n", driver->name);
+ pr_debug("unregistering driver %s\n", cpufreq_driver->name);
/* Protect against concurrent cpu hotplug */
cpus_read_lock();
--
2.34.1
Powered by blists - more mailing lists