Commit f13c193a authored by Patrick Mochel's avatar Patrick Mochel

[driver model] Clean up CPU unregistration.

From Dave Jones.
parent ed7f90bc
...@@ -46,7 +46,7 @@ int __init register_cpu(struct cpu *cpu, int num, struct node *root) ...@@ -46,7 +46,7 @@ int __init register_cpu(struct cpu *cpu, int num, struct node *root)
snprintf(cpu->sysdev.class_dev.class_id, BUS_ID_SIZE, "cpu%d", num); snprintf(cpu->sysdev.class_dev.class_id, BUS_ID_SIZE, "cpu%d", num);
retval = class_device_register(&cpu->sysdev.class_dev); retval = class_device_register(&cpu->sysdev.class_dev);
if (retval) { if (retval) {
// FIXME cleanup sys_device_register sys_device_unregister(&cpu->sysdev);
return retval; return retval;
} }
return 0; return 0;
...@@ -58,10 +58,12 @@ int __init cpu_dev_init(void) ...@@ -58,10 +58,12 @@ int __init cpu_dev_init(void)
int error; int error;
error = class_register(&cpu_class); error = class_register(&cpu_class);
if (!error) { if (error)
error = driver_register(&cpu_driver); goto out;
if (error)
class_unregister(&cpu_class); error = driver_register(&cpu_driver);
} if (error)
class_unregister(&cpu_class);
out:
return error; return error;
} }
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