public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* sysfs bits
@ 2003-05-15  3:31 davej
  2003-05-15  3:33 ` Patrick Mochel
  2003-05-15  5:06 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: davej @ 2003-05-15  3:31 UTC (permalink / raw)
  To: mochel; +Cc: linux-kernel

Look sane ?

diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/base/cpu.c linux-2.5/drivers/base/cpu.c
--- bk-linus/drivers/base/cpu.c	2003-04-30 16:02:26.000000000 +0100
+++ linux-2.5/drivers/base/cpu.c	2003-05-01 03:12:55.000000000 +0100
@@ -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;
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-05-15  5:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-15  3:31 sysfs bits davej
2003-05-15  3:33 ` Patrick Mochel
2003-05-15  5:06 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox