All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: "André Przywara" <andre@andrep.de>,
	"Leonid Isaev" <lisaev@umail.iu.edu>,
	"Tom Gundersen" <teg@jklm.no>,
	cpufreq@vger.kernel.org, linux-acpi@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	"Borislav Petkov" <bp@suse.de>
Subject: [PATCH 4/6] cpufreq: Add a get_current_driver helper
Date: Sun, 20 Jan 2013 11:24:28 +0100	[thread overview]
Message-ID: <1358677470-17394-5-git-send-email-bp@alien8.de> (raw)
In-Reply-To: <1358677470-17394-1-git-send-email-bp@alien8.de>

From: Borislav Petkov <bp@suse.de>

Add a helper function to return cpufreq_driver->name.

Signed-off-by: Borislav Petkov <bp@suse.de>
---
 drivers/cpufreq/cpufreq.c | 14 ++++++++++++++
 include/linux/cpufreq.h   |  1 +
 2 files changed, 15 insertions(+)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 1f93dbd72355..6ed3c1377caf 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1386,6 +1386,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                      *
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index a55b88eaf96a..a018da2d2a7c 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -407,4 +407,5 @@ void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
 				      unsigned int cpu);
 
 void cpufreq_frequency_table_put_attr(unsigned int cpu);
+extern const char *cpufreq_get_current_driver(void);
 #endif /* _LINUX_CPUFREQ_H */
-- 
1.8.1.rc3

  parent reply	other threads:[~2013-01-20 10:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-20 10:24 [PATCH 0/6] acpi-cpufreq and powernow-k8 fixes Borislav Petkov
2013-01-20 10:24 ` [PATCH 1/6] powernow-k8: Add a kconfig dependency on acpi-cpufreq Borislav Petkov
2013-01-20 10:24 ` [PATCH 2/6] acpi-cpufreq: Do not load on K8 Borislav Petkov
2013-01-20 10:24 ` [PATCH 3/6] cpufreq: Make acpi-cpufreq link first Borislav Petkov
2013-01-20 10:24 ` Borislav Petkov [this message]
2013-01-28  4:37   ` [PATCH 4/6] cpufreq: Add a get_current_driver helper Viresh Kumar
2013-01-28  9:49     ` Borislav Petkov
2013-01-28  9:49       ` Borislav Petkov
2013-01-28  9:52       ` Viresh Kumar
2013-01-20 10:24 ` [PATCH 5/6] powernow-k8: Cleanup module request Borislav Petkov
2013-01-20 10:24 ` [PATCH 6/6] powernow-k8: Cleanup init function Borislav Petkov
2013-01-20 14:18 ` [PATCH 0/6] acpi-cpufreq and powernow-k8 fixes Rafael J. Wysocki
2013-01-21  0:04   ` Borislav Petkov
2013-01-21  0:13     ` Rafael J. Wysocki
2013-01-22 14:00 ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1358677470-17394-5-git-send-email-bp@alien8.de \
    --to=bp@alien8.de \
    --cc=andre@andrep.de \
    --cc=bp@suse.de \
    --cc=cpufreq@vger.kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lisaev@umail.iu.edu \
    --cc=rjw@sisk.pl \
    --cc=teg@jklm.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.