Skip to contentSkip to conversation

sysfs bits

PATCH [email protected] 3 participants 3 messages May 15, 2003 Driver core

lore
Share & tools
lore
#0 lore raw

Look sane ?

drivers/base/cpu.c +8 -6
diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/base/cpu.c linux-2.5/drivers/base/cpu.c
@@ -46,7 +46,7 @@ int __init register_cpu(struct cpu *cpu,
 	snprintf(cpu->sysdev.class_dev.class_id, BUS_ID_SIZE, "cpu%d", num);
 	retval = class_device_register(&cpu->sysdev.class_dev);
 	if (retval) {
-		// FIXME cleanup sys_device_register
+		sys_device_unregister(&cpu->sysdev);
 		return retval;
 	}
 	return 0;
@@ -58,10 +58,12 @@ int __init cpu_dev_init(void)
 	int error;
 
 	error = class_register(&cpu_class);
-	if (!error) {
-		error = driver_register(&cpu_driver);
-		if (error)
-			class_unregister(&cpu_class);
-	}
+	if (error)
+		goto out;
+	
+	error = driver_register(&cpu_driver);
+	if (error)
+		class_unregister(&cpu_class);
+out:
 	return error;
 }
#2 lore raw
In reply to [email protected]

drivers/base/cpu.c int __init register_cpu(struct cpu *cpu, · line 49

Quoted 10 lines · On Thu, May 15, 2003 at 04:31:02AM +0100, [email protected] wrote:

Look sane ?

diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/base/cpu.c linux-2.5/drivers/base/cpu.c

drivers/base/cpu.c +0 -1
@@ -46,7 +46,7 @@ int __init register_cpu(struct cpu *cpu,
 	snprintf(cpu->sysdev.class_dev.class_id, BUS_ID_SIZE, "cpu%d", num);
 	retval = class_device_register(&cpu->sysdev.class_dev);
 	if (retval) {
-		// FIXME cleanup sys_device_register

Thanks, that was my fault for not fixing this properly the first time.

greg k-h