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)
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;
......
......@@ -552,7 +552,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;
}
......
......@@ -218,7 +218,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);
......@@ -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