Commit 205d07a9 authored by Patrick Mochel's avatar Patrick Mochel

Merge hostme.bitkeeper.com:/ua/repos/l/ldm/linux-2.5

into hostme.bitkeeper.com:/ua/repos/l/ldm/linux-2.5-core
parents f741fc08 547ac1b0
#undef DEBUG
extern struct semaphore device_sem; extern struct semaphore device_sem;
extern struct semaphore devclass_sem; extern struct semaphore devclass_sem;
......
...@@ -48,6 +48,9 @@ int __init register_cpu(struct cpu *cpu, int num, struct node *root) ...@@ -48,6 +48,9 @@ int __init register_cpu(struct cpu *cpu, int num, struct node *root)
int __init cpu_dev_init(void) int __init cpu_dev_init(void)
{ {
devclass_register(&cpu_devclass); int error;
return driver_register(&cpu_driver); 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) ...@@ -82,6 +82,7 @@ void put_driver(struct device_driver * drv)
int driver_register(struct device_driver * drv) int driver_register(struct device_driver * drv)
{ {
INIT_LIST_HEAD(&drv->devices); INIT_LIST_HEAD(&drv->devices);
INIT_LIST_HEAD(&drv->class_list);
init_MUTEX_LOCKED(&drv->unload_sem); init_MUTEX_LOCKED(&drv->unload_sem);
return bus_add_driver(drv); return bus_add_driver(drv);
} }
......
...@@ -47,9 +47,12 @@ int __init register_memblk(struct memblk *memblk, int num, struct node *root) ...@@ -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); int error;
return error ? error : driver_register(&memblk_driver); if (!(error = devclass_register(&memblk_devclass)))
if (error = driver_register(&memblk_driver))
devclass_unregister(&memblk_devclass);
return error;
} }
postcore_initcall(register_memblk_type); postcore_initcall(register_memblk_type);
...@@ -89,9 +89,12 @@ int __init register_node(struct node *node, int num, struct node *parent) ...@@ -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); int error;
return error ? error : driver_register(&node_driver); if (!(error = devclass_register(&node_devclass)))
if (error = driver_register(&node_driver))
devclass_unregister(&node_devclass);
return error;
} }
postcore_initcall(register_node_type); postcore_initcall(register_node_type);
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#define DEVICE_NAME_SIZE 50 #define DEVICE_NAME_SIZE 50
#define DEVICE_NAME_HALF __stringify(20) /* Less than half to accommodate slop */ #define DEVICE_NAME_HALF __stringify(20) /* Less than half to accommodate slop */
#define DEVICE_ID_SIZE 32 #define DEVICE_ID_SIZE 32
#define BUS_ID_SIZE 16 #define BUS_ID_SIZE 20
enum { 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