LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: tidy-up of_register_driver()/driver_register() return values
@ 2006-03-02 23:16 Bjorn Helgaas
  0 siblings, 0 replies; only message in thread
From: Bjorn Helgaas @ 2006-03-02 23:16 UTC (permalink / raw)
  To: Paul Mackerras, Benjamin Herrenschmidt; +Cc: Andrew Morton, linuxppc-dev

Remove the assumption that driver_register() returns the number of
devices bound to the driver.  In fact, it returns zero for success
or a negative error value.

Nobody uses the return value of of_register_driver() anyway.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>

Index: work-mm4/arch/powerpc/kernel/of_device.c
===================================================================
--- work-mm4.orig/arch/powerpc/kernel/of_device.c	2006-03-01 15:37:13.000000000 -0700
+++ work-mm4/arch/powerpc/kernel/of_device.c	2006-03-02 10:46:58.000000000 -0700
@@ -147,15 +147,12 @@
 
 int of_register_driver(struct of_platform_driver *drv)
 {
-	int count = 0;
-
 	/* initialize common driver fields */
 	drv->driver.name = drv->name;
 	drv->driver.bus = &of_platform_bus_type;
 
 	/* register with core */
-	count = driver_register(&drv->driver);
-	return count ? count : 1;
+	return driver_register(&drv->driver);
 }
 
 void of_unregister_driver(struct of_platform_driver *drv)
Index: work-mm4/drivers/macintosh/smu.c
===================================================================
--- work-mm4.orig/drivers/macintosh/smu.c	2006-03-01 15:37:41.000000000 -0700
+++ work-mm4/drivers/macintosh/smu.c	2006-03-02 10:47:30.000000000 -0700
@@ -630,8 +630,6 @@
 
 static int __init smu_init_sysfs(void)
 {
-	int rc;
-
 	/*
 	 * Due to sysfs bogosity, a sysdev is not a real device, so
 	 * we should in fact create both if we want sysdev semantics
@@ -640,7 +638,7 @@
 	 * I'm a bit too far from figuring out how that works with those
 	 * new chipsets, but that will come back and bite us
 	 */
-	rc = of_register_driver(&smu_of_platform_driver);
+	of_register_driver(&smu_of_platform_driver);
 	return 0;
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-03-02 23:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-02 23:16 [PATCH] powerpc: tidy-up of_register_driver()/driver_register() return values Bjorn Helgaas

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