Commit c03239b7 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://ldm.bkbits.net/linux-2.5-core

into home.transmeta.com:/home/torvalds/v2.5/linux
parents c87aba22 26701026
#undef DEBUG
extern struct semaphore device_sem;
extern struct semaphore devclass_sem;
......
......@@ -48,6 +48,9 @@ int __init register_cpu(struct cpu *cpu, int num, struct node *root)
int __init cpu_dev_init(void)
{
devclass_register(&cpu_devclass);
return driver_register(&cpu_driver);
int error;
if (!(error = devclass_register(&cpu_devclass)))
if ((error = driver_register(&cpu_driver)))
devclass_unregister(&cpu_devclass);
return error;
}
......@@ -82,6 +82,7 @@ void put_driver(struct device_driver * drv)
int driver_register(struct device_driver * drv)
{
INIT_LIST_HEAD(&drv->devices);
INIT_LIST_HEAD(&drv->class_list);
init_MUTEX_LOCKED(&drv->unload_sem);
return bus_add_driver(drv);
}
......
......@@ -47,9 +47,12 @@ int __init register_memblk(struct memblk *memblk, int num, struct node *root)
}
static int __init register_memblk_type(void)
int __init register_memblk_type(void)
{
int error = devclass_register(&memblk_devclass);
return error ? error : driver_register(&memblk_driver);
int error;
if (!(error = devclass_register(&memblk_devclass)))
if (error = driver_register(&memblk_driver))
devclass_unregister(&memblk_devclass);
return error;
}
postcore_initcall(register_memblk_type);
......@@ -89,9 +89,12 @@ int __init register_node(struct node *node, int num, struct node *parent)
}
static int __init register_node_type(void)
int __init register_node_type(void)
{
int error = devclass_register(&node_devclass);
return error ? error : driver_register(&node_driver);
int error;
if (!(error = devclass_register(&node_devclass)))
if (error = driver_register(&node_driver))
devclass_unregister(&node_devclass);
return error;
}
postcore_initcall(register_node_type);
......@@ -97,7 +97,7 @@ void sysfs_hash_and_remove(struct dentry * dir, const char * name)
atomic_read(&victim->d_count));
simple_unlink(dir->d_inode,victim);
d_delete(victim);
}
/*
* Drop reference from sysfs_get_dentry() above.
......
......@@ -35,7 +35,7 @@
#define DEVICE_NAME_SIZE 50
#define DEVICE_NAME_HALF __stringify(20) /* Less than half to accommodate slop */
#define DEVICE_ID_SIZE 32
#define BUS_ID_SIZE 16
#define BUS_ID_SIZE 20
enum {
......
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