Commit 117ace26 authored by Randy Dunlap's avatar Randy Dunlap Committed by Stephen Hemminger

[PATCH] sys_device_[un]register() are not syscalls

sys_xyz() names in Linux are all syscalls... except for
sys_device_register() and sys_device_unregister().

This patch renames them so that the sys_ namespace is once
again used only by syscalls.
parent 70b19320
...@@ -178,7 +178,7 @@ static int __init leds_init(void) ...@@ -178,7 +178,7 @@ static int __init leds_init(void)
int ret; int ret;
ret = sysdev_class_register(&leds_sysclass); ret = sysdev_class_register(&leds_sysclass);
if (ret == 0) if (ret == 0)
ret = sys_device_register(&leds_device); ret = sysdev_register(&leds_device);
return ret; return ret;
} }
......
...@@ -173,7 +173,7 @@ static int __init irq_init_sysfs(void) ...@@ -173,7 +173,7 @@ static int __init irq_init_sysfs(void)
{ {
int ret = sysdev_class_register(&irq_class); int ret = sysdev_class_register(&irq_class);
if (ret == 0) if (ret == 0)
ret = sys_device_register(&irq_device); ret = sysdev_register(&irq_device);
return ret; return ret;
} }
......
...@@ -278,7 +278,7 @@ static struct sys_device sa1100irq_device = { ...@@ -278,7 +278,7 @@ static struct sys_device sa1100irq_device = {
static int __init sa1100irq_init_devicefs(void) static int __init sa1100irq_init_devicefs(void)
{ {
sysdev_class_register(&sa1100irq_sysclass); sysdev_class_register(&sa1100irq_sysclass);
return sys_device_register(&sa1100irq_device); return sysdev_register(&sa1100irq_device);
} }
device_initcall(sa1100irq_init_devicefs); device_initcall(sa1100irq_init_devicefs);
......
...@@ -595,7 +595,7 @@ static int __init init_lapic_sysfs(void) ...@@ -595,7 +595,7 @@ static int __init init_lapic_sysfs(void)
error = sysdev_class_register(&lapic_sysclass); error = sysdev_class_register(&lapic_sysclass);
if (!error) if (!error)
error = sys_device_register(&device_lapic); error = sysdev_register(&device_lapic);
return error; return error;
} }
device_initcall(init_lapic_sysfs); device_initcall(init_lapic_sysfs);
......
...@@ -258,7 +258,7 @@ static int __init i8259A_init_sysfs(void) ...@@ -258,7 +258,7 @@ static int __init i8259A_init_sysfs(void)
{ {
int error = sysdev_class_register(&i8259_sysdev_class); int error = sysdev_class_register(&i8259_sysdev_class);
if (!error) if (!error)
error = sys_device_register(&device_i8259A); error = sysdev_register(&device_i8259A);
return error; return error;
} }
...@@ -401,7 +401,7 @@ static int __init init_timer_sysfs(void) ...@@ -401,7 +401,7 @@ static int __init init_timer_sysfs(void)
{ {
int error = sysdev_class_register(&timer_sysclass); int error = sysdev_class_register(&timer_sysclass);
if (!error) if (!error)
error = sys_device_register(&device_timer); error = sysdev_register(&device_timer);
return error; return error;
} }
......
...@@ -248,7 +248,7 @@ static int __init init_lapic_nmi_sysfs(void) ...@@ -248,7 +248,7 @@ static int __init init_lapic_nmi_sysfs(void)
error = sysdev_class_register(&nmi_sysclass); error = sysdev_class_register(&nmi_sysclass);
if (!error) if (!error)
error = sys_device_register(&device_lapic_nmi); error = sysdev_register(&device_lapic_nmi);
return error; return error;
} }
/* must come after the local APIC's device_initcall() */ /* must come after the local APIC's device_initcall() */
......
...@@ -346,7 +346,7 @@ static int time_init_device(void) ...@@ -346,7 +346,7 @@ static int time_init_device(void)
{ {
int error = sysdev_class_register(&pit_sysclass); int error = sysdev_class_register(&pit_sysclass);
if (!error) if (!error)
error = sys_device_register(&device_i8253); error = sysdev_register(&device_i8253);
return error; return error;
} }
......
...@@ -65,14 +65,14 @@ static int __init init_driverfs(void) ...@@ -65,14 +65,14 @@ static int __init init_driverfs(void)
{ {
int error; int error;
if (!(error = sysdev_class_register(&oprofile_sysclass))) if (!(error = sysdev_class_register(&oprofile_sysclass)))
error = sys_device_register(&device_oprofile); error = sysdev_register(&device_oprofile);
return error; return error;
} }
static void __exit exit_driverfs(void) static void __exit exit_driverfs(void)
{ {
sys_device_unregister(&device_oprofile); sysdev_unregister(&device_oprofile);
sysdev_class_unregister(&oprofile_sysclass); sysdev_class_unregister(&oprofile_sysclass);
} }
......
...@@ -242,7 +242,7 @@ static int __init i8259A_init_sysfs(void) ...@@ -242,7 +242,7 @@ static int __init i8259A_init_sysfs(void)
{ {
int error = sysdev_class_register(&i8259_sysdev_class); int error = sysdev_class_register(&i8259_sysdev_class);
if (!error) if (!error)
error = sys_device_register(&device_i8259A); error = sysdev_register(&device_i8259A);
return error; return error;
} }
......
...@@ -646,7 +646,7 @@ static int __init init_pmacpic_sysfs(void) ...@@ -646,7 +646,7 @@ static int __init init_pmacpic_sysfs(void)
printk(KERN_DEBUG "Registering pmac pic with sysfs...\n"); printk(KERN_DEBUG "Registering pmac pic with sysfs...\n");
sysdev_class_register(&pmacpic_sysclass); sysdev_class_register(&pmacpic_sysclass);
sys_device_register(&device_pmacpic); sysdev_register(&device_pmacpic);
sysdev_driver_register(&pmacpic_sysclass, &driver_pmacpic); sysdev_driver_register(&pmacpic_sysclass, &driver_pmacpic);
return 0; return 0;
} }
......
...@@ -1032,7 +1032,7 @@ static int __init init_openpic_sysfs(void) ...@@ -1032,7 +1032,7 @@ static int __init init_openpic_sysfs(void)
printk(KERN_ERR "Failed registering openpic sys class\n"); printk(KERN_ERR "Failed registering openpic sys class\n");
return -ENODEV; return -ENODEV;
} }
rc = sys_device_register(&device_openpic); rc = sysdev_register(&device_openpic);
if (rc) { if (rc) {
printk(KERN_ERR "Failed registering openpic sys device\n"); printk(KERN_ERR "Failed registering openpic sys device\n");
return -ENODEV; return -ENODEV;
......
...@@ -699,7 +699,7 @@ static int __init init_openpic2_sysfs(void) ...@@ -699,7 +699,7 @@ static int __init init_openpic2_sysfs(void)
printk(KERN_ERR "Failed registering openpic sys class\n"); printk(KERN_ERR "Failed registering openpic sys class\n");
return -ENODEV; return -ENODEV;
} }
rc = sys_device_register(&device_openpic2); rc = sysdev_register(&device_openpic2);
if (rc) { if (rc) {
printk(KERN_ERR "Failed registering openpic sys device\n"); printk(KERN_ERR "Failed registering openpic sys device\n");
return -ENODEV; return -ENODEV;
......
...@@ -552,7 +552,7 @@ static int __init init_lapic_sysfs(void) ...@@ -552,7 +552,7 @@ static int __init init_lapic_sysfs(void)
/* XXX: remove suspend/resume procs if !apic_pm_state.active? */ /* XXX: remove suspend/resume procs if !apic_pm_state.active? */
error = sysdev_class_register(&lapic_sysclass); error = sysdev_class_register(&lapic_sysclass);
if (!error) if (!error)
error = sys_device_register(&device_lapic); error = sysdev_register(&device_lapic);
return error; return error;
} }
device_initcall(init_lapic_sysfs); device_initcall(init_lapic_sysfs);
......
...@@ -430,7 +430,7 @@ static int __init init_timer_sysfs(void) ...@@ -430,7 +430,7 @@ static int __init init_timer_sysfs(void)
{ {
int error = sysdev_class_register(&timer_sysclass); int error = sysdev_class_register(&timer_sysclass);
if (!error) if (!error)
error = sys_device_register(&device_timer); error = sysdev_register(&device_timer);
return error; return error;
} }
......
...@@ -218,7 +218,7 @@ static int __init init_lapic_nmi_sysfs(void) ...@@ -218,7 +218,7 @@ static int __init init_lapic_nmi_sysfs(void)
error = sysdev_class_register(&nmi_sysclass); error = sysdev_class_register(&nmi_sysclass);
if (!error) if (!error)
error = sys_device_register(&device_lapic_nmi); error = sysdev_register(&device_lapic_nmi);
return error; return error;
} }
/* must come after the local APIC's device_initcall() */ /* 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) ...@@ -29,7 +29,7 @@ int __init register_cpu(struct cpu *cpu, int num, struct node *root)
cpu->sysdev.id = num; cpu->sysdev.id = num;
cpu->sysdev.cls = &cpu_sysdev_class; cpu->sysdev.cls = &cpu_sysdev_class;
error = sys_device_register(&cpu->sysdev); error = sysdev_register(&cpu->sysdev);
if (!error && root) if (!error && root)
error = sysfs_create_link(&root->sysdev.kobj, error = sysfs_create_link(&root->sysdev.kobj,
&cpu->sysdev.kobj, &cpu->sysdev.kobj,
......
...@@ -69,7 +69,7 @@ int __init register_node(struct node *node, int num, struct node *parent) ...@@ -69,7 +69,7 @@ int __init register_node(struct node *node, int num, struct node *parent)
node->cpumap = node_to_cpumask(num); node->cpumap = node_to_cpumask(num);
node->sysdev.id = num; node->sysdev.id = num;
node->sysdev.cls = &node_class; node->sysdev.cls = &node_class;
error = sys_device_register(&node->sysdev); error = sysdev_register(&node->sysdev);
if (!error){ if (!error){
sysdev_create_file(&node->sysdev, &attr_cpumap); sysdev_create_file(&node->sysdev, &attr_cpumap);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* This exports a 'system' bus type. * This exports a 'system' bus type.
* By default, a 'sys' bus gets added to the root of the system. There will * 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. * add themselves as children of the system bus.
*/ */
...@@ -164,11 +164,11 @@ EXPORT_SYMBOL(sysdev_driver_unregister); ...@@ -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 * @sysdev: device in question
* *
*/ */
int sys_device_register(struct sys_device * sysdev) int sysdev_register(struct sys_device * sysdev)
{ {
int error; int error;
struct sysdev_class * cls = sysdev->cls; struct sysdev_class * cls = sysdev->cls;
...@@ -212,7 +212,7 @@ int sys_device_register(struct sys_device * sysdev) ...@@ -212,7 +212,7 @@ int sys_device_register(struct sys_device * sysdev)
return error; return error;
} }
void sys_device_unregister(struct sys_device * sysdev) void sysdev_unregister(struct sys_device * sysdev)
{ {
struct sysdev_driver * drv; struct sysdev_driver * drv;
...@@ -390,5 +390,5 @@ int __init sys_bus_init(void) ...@@ -390,5 +390,5 @@ int __init sys_bus_init(void)
return subsystem_register(&system_subsys); return subsystem_register(&system_subsys);
} }
EXPORT_SYMBOL(sys_device_register); EXPORT_SYMBOL(sysdev_register);
EXPORT_SYMBOL(sys_device_unregister); EXPORT_SYMBOL(sysdev_unregister);
...@@ -957,7 +957,7 @@ int __init i8042_init(void) ...@@ -957,7 +957,7 @@ int __init i8042_init(void)
mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD); mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD);
if (sysdev_class_register(&kbc_sysclass) == 0) { if (sysdev_class_register(&kbc_sysclass) == 0) {
if (sys_device_register(&device_i8042) == 0) if (sysdev_register(&device_i8042) == 0)
i8042_sysdev_initialized = 1; i8042_sysdev_initialized = 1;
else else
sysdev_class_unregister(&kbc_sysclass); sysdev_class_unregister(&kbc_sysclass);
...@@ -980,7 +980,7 @@ void __exit i8042_exit(void) ...@@ -980,7 +980,7 @@ void __exit i8042_exit(void)
pm_unregister(i8042_pm_dev); pm_unregister(i8042_pm_dev);
if (i8042_sysdev_initialized) { if (i8042_sysdev_initialized) {
sys_device_unregister(&device_i8042); sysdev_unregister(&device_i8042);
sysdev_class_unregister(&kbc_sysclass); sysdev_class_unregister(&kbc_sysclass);
} }
......
...@@ -492,7 +492,7 @@ static void __exit xpram_exit(void) ...@@ -492,7 +492,7 @@ static void __exit xpram_exit(void)
} }
unregister_blkdev(XPRAM_MAJOR, XPRAM_NAME); unregister_blkdev(XPRAM_MAJOR, XPRAM_NAME);
devfs_remove("slram"); devfs_remove("slram");
sys_device_unregister(&xpram_sys_device); sysdev_unregister(&xpram_sys_device);
sysdev_class_unregister(&xpram_sysclass); sysdev_class_unregister(&xpram_sysclass);
} }
...@@ -515,14 +515,14 @@ static int __init xpram_init(void) ...@@ -515,14 +515,14 @@ static int __init xpram_init(void)
if (rc) if (rc)
return rc; return rc;
rc = sys_device_register(&xpram_sys_device); rc = sysdev_register(&xpram_sys_device);
if (rc) { if (rc) {
sysdev_class_unregister(&xpram_sysclass); sysdev_class_unregister(&xpram_sysclass);
return rc; return rc;
} }
rc = xpram_setup_blkdev(); rc = xpram_setup_blkdev();
if (rc) if (rc)
sys_device_unregister(&xpram_sys_device); sysdev_unregister(&xpram_sys_device);
return rc; return rc;
} }
......
...@@ -70,8 +70,8 @@ struct sys_device { ...@@ -70,8 +70,8 @@ struct sys_device {
struct kobject kobj; struct kobject kobj;
}; };
extern int sys_device_register(struct sys_device *); extern int sysdev_register(struct sys_device *);
extern void sys_device_unregister(struct sys_device *); extern void sysdev_unregister(struct sys_device *);
struct sysdev_attribute { 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