summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpuid.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2009-04-30 15:23:42 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-16 06:30:25 +0200
commit07e9bb8eebb04c81323cbd3eabf07a3f6f05b204 (patch)
tree45054dee75c6b6c3fab5eb6be1f14c6f720995ce /arch/x86/kernel/cpuid.c
parentDriver Core: block: add nodename support for block drivers. (diff)
downloadlinux-07e9bb8eebb04c81323cbd3eabf07a3f6f05b204.tar.xz
linux-07e9bb8eebb04c81323cbd3eabf07a3f6f05b204.zip
Driver Core: x86: add nodename for cpuid and msr drivers.
This adds support to the x86 cpuid and msr drivers to report the proper device name to userspace for their devices. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Jan Blunck <jblunck@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/x86/kernel/cpuid.c')
-rw-r--r--arch/x86/kernel/cpuid.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index 2ac1f0c2beb3..b07af8861244 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -182,6 +182,11 @@ static struct notifier_block __refdata cpuid_class_cpu_notifier =
.notifier_call = cpuid_class_cpu_callback,
};
+static char *cpuid_nodename(struct device *dev)
+{
+ return kasprintf(GFP_KERNEL, "cpu/%u/cpuid", MINOR(dev->devt));
+}
+
static int __init cpuid_init(void)
{
int i, err = 0;
@@ -198,6 +203,7 @@ static int __init cpuid_init(void)
err = PTR_ERR(cpuid_class);
goto out_chrdev;
}
+ cpuid_class->nodename = cpuid_nodename;
for_each_online_cpu(i) {
err = cpuid_device_create(i);
if (err != 0)