Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2334
b: refs/heads/master
c: 8874b41
h: refs/heads/master
v: v3
  • Loading branch information
gregkh@suse.de committed Jun 20, 2005
1 parent 3ee8262 commit 76e5c44
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d253878b3d9ae523c76118f5336a662780ad3757
refs/heads/master: 8874b414ffe037c39e73bb262ddf69653a13c0a4
22 changes: 11 additions & 11 deletions trunk/arch/i386/kernel/cpuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include <asm/uaccess.h>
#include <asm/system.h>

static struct class_simple *cpuid_class;
static struct class *cpuid_class;

#ifdef CONFIG_SMP

Expand Down Expand Up @@ -158,12 +158,12 @@ static struct file_operations cpuid_fops = {
.open = cpuid_open,
};

static int cpuid_class_simple_device_add(int i)
static int cpuid_class_device_create(int i)
{
int err = 0;
struct class_device *class_err;

class_err = class_simple_device_add(cpuid_class, MKDEV(CPUID_MAJOR, i), NULL, "cpu%d",i);
class_err = class_device_create(cpuid_class, MKDEV(CPUID_MAJOR, i), NULL, "cpu%d",i);
if (IS_ERR(class_err))
err = PTR_ERR(class_err);
return err;
Expand All @@ -175,10 +175,10 @@ static int __devinit cpuid_class_cpu_callback(struct notifier_block *nfb, unsign

switch (action) {
case CPU_ONLINE:
cpuid_class_simple_device_add(cpu);
cpuid_class_device_create(cpu);
break;
case CPU_DEAD:
class_simple_device_remove(MKDEV(CPUID_MAJOR, cpu));
class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, cpu));
break;
}
return NOTIFY_OK;
Expand All @@ -200,13 +200,13 @@ static int __init cpuid_init(void)
err = -EBUSY;
goto out;
}
cpuid_class = class_simple_create(THIS_MODULE, "cpuid");
cpuid_class = class_create(THIS_MODULE, "cpuid");
if (IS_ERR(cpuid_class)) {
err = PTR_ERR(cpuid_class);
goto out_chrdev;
}
for_each_online_cpu(i) {
err = cpuid_class_simple_device_add(i);
err = cpuid_class_device_create(i);
if (err != 0)
goto out_class;
}
Expand All @@ -218,9 +218,9 @@ static int __init cpuid_init(void)
out_class:
i = 0;
for_each_online_cpu(i) {
class_simple_device_remove(MKDEV(CPUID_MAJOR, i));
class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, i));
}
class_simple_destroy(cpuid_class);
class_destroy(cpuid_class);
out_chrdev:
unregister_chrdev(CPUID_MAJOR, "cpu/cpuid");
out:
Expand All @@ -232,8 +232,8 @@ static void __exit cpuid_exit(void)
int cpu = 0;

for_each_online_cpu(cpu)
class_simple_device_remove(MKDEV(CPUID_MAJOR, cpu));
class_simple_destroy(cpuid_class);
class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, cpu));
class_destroy(cpuid_class);
unregister_chrdev(CPUID_MAJOR, "cpu/cpuid");
unregister_cpu_notifier(&cpuid_class_cpu_notifier);
}
Expand Down
22 changes: 11 additions & 11 deletions trunk/arch/i386/kernel/msr.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include <asm/uaccess.h>
#include <asm/system.h>

static struct class_simple *msr_class;
static struct class *msr_class;

/* Note: "err" is handled in a funny way below. Otherwise one version
of gcc or another breaks. */
Expand Down Expand Up @@ -260,12 +260,12 @@ static struct file_operations msr_fops = {
.open = msr_open,
};

static int msr_class_simple_device_add(int i)
static int msr_class_device_create(int i)
{
int err = 0;
struct class_device *class_err;

class_err = class_simple_device_add(msr_class, MKDEV(MSR_MAJOR, i), NULL, "msr%d",i);
class_err = class_device_create(msr_class, MKDEV(MSR_MAJOR, i), NULL, "msr%d",i);
if (IS_ERR(class_err))
err = PTR_ERR(class_err);
return err;
Expand All @@ -277,10 +277,10 @@ static int __devinit msr_class_cpu_callback(struct notifier_block *nfb, unsigned

switch (action) {
case CPU_ONLINE:
msr_class_simple_device_add(cpu);
msr_class_device_create(cpu);
break;
case CPU_DEAD:
class_simple_device_remove(MKDEV(MSR_MAJOR, cpu));
class_device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu));
break;
}
return NOTIFY_OK;
Expand All @@ -302,13 +302,13 @@ static int __init msr_init(void)
err = -EBUSY;
goto out;
}
msr_class = class_simple_create(THIS_MODULE, "msr");
msr_class = class_create(THIS_MODULE, "msr");
if (IS_ERR(msr_class)) {
err = PTR_ERR(msr_class);
goto out_chrdev;
}
for_each_online_cpu(i) {
err = msr_class_simple_device_add(i);
err = msr_class_device_create(i);
if (err != 0)
goto out_class;
}
Expand All @@ -320,8 +320,8 @@ static int __init msr_init(void)
out_class:
i = 0;
for_each_online_cpu(i)
class_simple_device_remove(MKDEV(MSR_MAJOR, i));
class_simple_destroy(msr_class);
class_device_destroy(msr_class, MKDEV(MSR_MAJOR, i));
class_destroy(msr_class);
out_chrdev:
unregister_chrdev(MSR_MAJOR, "cpu/msr");
out:
Expand All @@ -332,8 +332,8 @@ static void __exit msr_exit(void)
{
int cpu = 0;
for_each_online_cpu(cpu)
class_simple_device_remove(MKDEV(MSR_MAJOR, cpu));
class_simple_destroy(msr_class);
class_device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu));
class_destroy(msr_class);
unregister_chrdev(MSR_MAJOR, "cpu/msr");
unregister_cpu_notifier(&msr_class_cpu_notifier);
}
Expand Down

0 comments on commit 76e5c44

Please sign in to comment.