summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2013-01-20 10:24:28 +0000
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-02-02 00:01:15 +0100
commit9d95046e5d6afd6d7ae86fb71ab59c6faf0db8de (patch)
treef5f4314238fbc548ec9e3ab48affeeb8682577c8 /drivers/cpufreq/cpufreq.c
parent741220ea86709717e1d392b5a9617dfe90cd3802 (diff)
downloadlinux-3.10-9d95046e5d6afd6d7ae86fb71ab59c6faf0db8de.tar.gz
linux-3.10-9d95046e5d6afd6d7ae86fb71ab59c6faf0db8de.tar.bz2
linux-3.10-9d95046e5d6afd6d7ae86fb71ab59c6faf0db8de.zip
cpufreq: Add a get_current_driver helper
Add a helper function to return cpufreq_driver->name. Signed-off-by: Borislav Petkov <bp@suse.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r--drivers/cpufreq/cpufreq.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 2417576393a..216c104d51a 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1395,6 +1395,20 @@ static struct syscore_ops cpufreq_syscore_ops = {
.resume = cpufreq_bp_resume,
};
+/**
+ * cpufreq_get_current_driver - return current driver's name
+ *
+ * Return the name string of the currently loaded cpufreq driver
+ * or NULL, if none.
+ */
+const char *cpufreq_get_current_driver(void)
+{
+ if (cpufreq_driver)
+ return cpufreq_driver->name;
+
+ return NULL;
+}
+EXPORT_SYMBOL_GPL(cpufreq_get_current_driver);
/*********************************************************************
* NOTIFIER LISTS INTERFACE *