diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-04-30 17:23:42 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 08:30:25 +0400 |
commit | 07e9bb8eebb04c81323cbd3eabf07a3f6f05b204 (patch) | |
tree | 45054dee75c6b6c3fab5eb6be1f14c6f720995ce /arch/x86/kernel/msr.c | |
parent | b03f38b685e2e1db174fb8982930e789a516f414 (diff) | |
download | linux-07e9bb8eebb04c81323cbd3eabf07a3f6f05b204.tar.xz |
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/msr.c')
-rw-r--r-- | arch/x86/kernel/msr.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c index 3cf3413ec626..98fd6cd4e3a4 100644 --- a/arch/x86/kernel/msr.c +++ b/arch/x86/kernel/msr.c @@ -196,6 +196,11 @@ static struct notifier_block __refdata msr_class_cpu_notifier = { .notifier_call = msr_class_cpu_callback, }; +static char *msr_nodename(struct device *dev) +{ + return kasprintf(GFP_KERNEL, "cpu/%u/msr", MINOR(dev->devt)); +} + static int __init msr_init(void) { int i, err = 0; @@ -212,6 +217,7 @@ static int __init msr_init(void) err = PTR_ERR(msr_class); goto out_chrdev; } + msr_class->nodename = msr_nodename; for_each_online_cpu(i) { err = msr_device_create(i); if (err != 0) |