Commit 3a540b9d authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge kroah.com:/home/greg/linux/BK/bleed-2.6

into kroah.com:/home/greg/linux/BK/driver-2.6
parents ff4dc41e d7176726
......@@ -178,7 +178,7 @@ static int __init leds_init(void)
int ret;
ret = sysdev_class_register(&leds_sysclass);
if (ret == 0)
ret = sys_device_register(&leds_device);
ret = sysdev_register(&leds_device);
return ret;
}
......
......@@ -173,7 +173,7 @@ static int __init irq_init_sysfs(void)
{
int ret = sysdev_class_register(&irq_class);
if (ret == 0)
ret = sys_device_register(&irq_device);
ret = sysdev_register(&irq_device);
return ret;
}
......
......@@ -278,7 +278,7 @@ static struct sys_device sa1100irq_device = {
static int __init sa1100irq_init_devicefs(void)
{
sysdev_class_register(&sa1100irq_sysclass);
return sys_device_register(&sa1100irq_device);
return sysdev_register(&sa1100irq_device);
}
device_initcall(sa1100irq_init_devicefs);
......
......@@ -595,7 +595,7 @@ static int __init init_lapic_sysfs(void)
error = sysdev_class_register(&lapic_sysclass);
if (!error)
error = sys_device_register(&device_lapic);
error = sysdev_register(&device_lapic);
return error;
}
device_initcall(init_lapic_sysfs);
......
......@@ -258,7 +258,7 @@ static int __init i8259A_init_sysfs(void)
{
int error = sysdev_class_register(&i8259_sysdev_class);
if (!error)
error = sys_device_register(&device_i8259A);
error = sysdev_register(&device_i8259A);
return error;
}
......@@ -401,7 +401,7 @@ static int __init init_timer_sysfs(void)
{
int error = sysdev_class_register(&timer_sysclass);
if (!error)
error = sys_device_register(&device_timer);
error = sysdev_register(&device_timer);
return error;
}
......
......@@ -248,7 +248,7 @@ static int __init init_lapic_nmi_sysfs(void)
error = sysdev_class_register(&nmi_sysclass);
if (!error)
error = sys_device_register(&device_lapic_nmi);
error = sysdev_register(&device_lapic_nmi);
return error;
}
/* must come after the local APIC's device_initcall() */
......
......@@ -346,7 +346,7 @@ static int time_init_device(void)
{
int error = sysdev_class_register(&pit_sysclass);
if (!error)
error = sys_device_register(&device_i8253);
error = sysdev_register(&device_i8253);
return error;
}
......
......@@ -65,14 +65,14 @@ static int __init init_driverfs(void)
{
int error;
if (!(error = sysdev_class_register(&oprofile_sysclass)))
error = sys_device_register(&device_oprofile);
error = sysdev_register(&device_oprofile);
return error;
}
static void __exit exit_driverfs(void)
{
sys_device_unregister(&device_oprofile);
sysdev_unregister(&device_oprofile);
sysdev_class_unregister(&oprofile_sysclass);
}
......
......@@ -242,7 +242,7 @@ static int __init i8259A_init_sysfs(void)
{
int error = sysdev_class_register(&i8259_sysdev_class);
if (!error)
error = sys_device_register(&device_i8259A);
error = sysdev_register(&device_i8259A);
return error;
}
......
......@@ -646,7 +646,7 @@ static int __init init_pmacpic_sysfs(void)
printk(KERN_DEBUG "Registering pmac pic with sysfs...\n");
sysdev_class_register(&pmacpic_sysclass);
sys_device_register(&device_pmacpic);
sysdev_register(&device_pmacpic);
sysdev_driver_register(&pmacpic_sysclass, &driver_pmacpic);
return 0;
}
......
......@@ -1032,7 +1032,7 @@ static int __init init_openpic_sysfs(void)
printk(KERN_ERR "Failed registering openpic sys class\n");
return -ENODEV;
}
rc = sys_device_register(&device_openpic);
rc = sysdev_register(&device_openpic);
if (rc) {
printk(KERN_ERR "Failed registering openpic sys device\n");
return -ENODEV;
......
......@@ -699,7 +699,7 @@ static int __init init_openpic2_sysfs(void)
printk(KERN_ERR "Failed registering openpic sys class\n");
return -ENODEV;
}
rc = sys_device_register(&device_openpic2);
rc = sysdev_register(&device_openpic2);
if (rc) {
printk(KERN_ERR "Failed registering openpic sys device\n");
return -ENODEV;
......
......@@ -553,7 +553,7 @@ static int __init init_lapic_sysfs(void)
/* XXX: remove suspend/resume procs if !apic_pm_state.active? */
error = sysdev_class_register(&lapic_sysclass);
if (!error)
error = sys_device_register(&device_lapic);
error = sysdev_register(&device_lapic);
return error;
}
device_initcall(init_lapic_sysfs);
......
......@@ -430,7 +430,7 @@ static int __init init_timer_sysfs(void)
{
int error = sysdev_class_register(&timer_sysclass);
if (!error)
error = sys_device_register(&device_timer);
error = sysdev_register(&device_timer);
return error;
}
......
......@@ -241,7 +241,7 @@ static int __init init_lapic_nmi_sysfs(void)
error = sysdev_class_register(&nmi_sysclass);
if (!error)
error = sys_device_register(&device_lapic_nmi);
error = sysdev_register(&device_lapic_nmi);
return error;
}
/* must come after the local APIC's device_initcall() */
......
......@@ -29,7 +29,7 @@ int __init register_cpu(struct cpu *cpu, int num, struct node *root)
cpu->sysdev.id = num;
cpu->sysdev.cls = &cpu_sysdev_class;
error = sys_device_register(&cpu->sysdev);
error = sysdev_register(&cpu->sysdev);
if (!error && root)
error = sysfs_create_link(&root->sysdev.kobj,
&cpu->sysdev.kobj,
......
......@@ -69,7 +69,7 @@ int __init register_node(struct node *node, int num, struct node *parent)
node->cpumap = node_to_cpumask(num);
node->sysdev.id = num;
node->sysdev.cls = &node_class;
error = sys_device_register(&node->sysdev);
error = sysdev_register(&node->sysdev);
if (!error){
sysdev_create_file(&node->sysdev, &attr_cpumap);
......
......@@ -8,7 +8,7 @@
*
* This exports a 'system' bus type.
* By default, a 'sys' bus gets added to the root of the system. There will
* always be core system devices. Devices can use sys_device_register() to
* always be core system devices. Devices can use sysdev_register() to
* add themselves as children of the system bus.
*/
......@@ -164,11 +164,11 @@ EXPORT_SYMBOL(sysdev_driver_unregister);
/**
* sys_device_register - add a system device to the tree
* sysdev_register - add a system device to the tree
* @sysdev: device in question
*
*/
int sys_device_register(struct sys_device * sysdev)
int sysdev_register(struct sys_device * sysdev)
{
int error;
struct sysdev_class * cls = sysdev->cls;
......@@ -212,7 +212,7 @@ int sys_device_register(struct sys_device * sysdev)
return error;
}
void sys_device_unregister(struct sys_device * sysdev)
void sysdev_unregister(struct sys_device * sysdev)
{
struct sysdev_driver * drv;
......@@ -390,5 +390,5 @@ int __init sys_bus_init(void)
return subsystem_register(&system_subsys);
}
EXPORT_SYMBOL(sys_device_register);
EXPORT_SYMBOL(sys_device_unregister);
EXPORT_SYMBOL(sysdev_register);
EXPORT_SYMBOL(sysdev_unregister);
......@@ -212,6 +212,9 @@ static struct file_operations misc_fops = {
int misc_register(struct miscdevice * misc)
{
struct miscdevice *c;
struct class_device *class;
dev_t dev;
int err;
down(&misc_sem);
list_for_each_entry(c, &misc_list, list) {
......@@ -240,19 +243,30 @@ int misc_register(struct miscdevice * misc)
snprintf(misc->devfs_name, sizeof(misc->devfs_name),
"misc/%s", misc->name);
}
dev = MKDEV(MISC_MAJOR, misc->minor);
class_simple_device_add(misc_class, MKDEV(MISC_MAJOR, misc->minor),
misc->dev, misc->name);
devfs_mk_cdev(MKDEV(MISC_MAJOR, misc->minor),
S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP, misc->devfs_name);
class = class_simple_device_add(misc_class, dev,
misc->dev, misc->name);
if (IS_ERR(class)) {
err = PTR_ERR(class);
goto out;
}
err = devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP,
misc->devfs_name);
if (err) {
class_simple_device_remove(dev);
goto out;
}
/*
* Add it to the front, so that later devices can "override"
* earlier defaults
*/
list_add(&misc->list, &misc_list);
out:
up(&misc_sem);
return 0;
return err;
}
/**
......
......@@ -957,7 +957,7 @@ int __init i8042_init(void)
mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD);
if (sysdev_class_register(&kbc_sysclass) == 0) {
if (sys_device_register(&device_i8042) == 0)
if (sysdev_register(&device_i8042) == 0)
i8042_sysdev_initialized = 1;
else
sysdev_class_unregister(&kbc_sysclass);
......@@ -980,7 +980,7 @@ void __exit i8042_exit(void)
pm_unregister(i8042_pm_dev);
if (i8042_sysdev_initialized) {
sys_device_unregister(&device_i8042);
sysdev_unregister(&device_i8042);
sysdev_class_unregister(&kbc_sysclass);
}
......
......@@ -492,7 +492,7 @@ static void __exit xpram_exit(void)
}
unregister_blkdev(XPRAM_MAJOR, XPRAM_NAME);
devfs_remove("slram");
sys_device_unregister(&xpram_sys_device);
sysdev_unregister(&xpram_sys_device);
sysdev_class_unregister(&xpram_sysclass);
}
......@@ -515,14 +515,14 @@ static int __init xpram_init(void)
if (rc)
return rc;
rc = sys_device_register(&xpram_sys_device);
rc = sysdev_register(&xpram_sys_device);
if (rc) {
sysdev_class_unregister(&xpram_sysclass);
return rc;
}
rc = xpram_setup_blkdev();
if (rc)
sys_device_unregister(&xpram_sys_device);
sysdev_unregister(&xpram_sys_device);
return rc;
}
......
......@@ -70,8 +70,8 @@ struct sys_device {
struct kobject kobj;
};
extern int sys_device_register(struct sys_device *);
extern void sys_device_unregister(struct sys_device *);
extern int sysdev_register(struct sys_device *);
extern void sysdev_unregister(struct sys_device *);
struct sysdev_attribute {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment