浏览代码

[PATCH] powerpc: tidy-up of_register_driver()/driver_register() return values

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>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Bjorn Helgaas 19 年之前
父节点
当前提交
6ea671a12f
共有 2 个文件被更改,包括 2 次插入7 次删除
  1. 1 4
      arch/powerpc/kernel/of_device.c
  2. 1 3
      drivers/macintosh/smu.c

+ 1 - 4
arch/powerpc/kernel/of_device.c

@@ -147,15 +147,12 @@ postcore_initcall(of_bus_driver_init);
 
 
 int of_register_driver(struct of_platform_driver *drv)
 int of_register_driver(struct of_platform_driver *drv)
 {
 {
-	int count = 0;
-
 	/* initialize common driver fields */
 	/* initialize common driver fields */
 	drv->driver.name = drv->name;
 	drv->driver.name = drv->name;
 	drv->driver.bus = &of_platform_bus_type;
 	drv->driver.bus = &of_platform_bus_type;
 
 
 	/* register with core */
 	/* 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)
 void of_unregister_driver(struct of_platform_driver *drv)

+ 1 - 3
drivers/macintosh/smu.c

@@ -629,8 +629,6 @@ static struct of_platform_driver smu_of_platform_driver =
 
 
 static int __init smu_init_sysfs(void)
 static int __init smu_init_sysfs(void)
 {
 {
-	int rc;
-
 	/*
 	/*
 	 * Due to sysfs bogosity, a sysdev is not a real device, so
 	 * Due to sysfs bogosity, a sysdev is not a real device, so
 	 * we should in fact create both if we want sysdev semantics
 	 * we should in fact create both if we want sysdev semantics
@@ -639,7 +637,7 @@ static int __init smu_init_sysfs(void)
 	 * I'm a bit too far from figuring out how that works with those
 	 * I'm a bit too far from figuring out how that works with those
 	 * new chipsets, but that will come back and bite us
 	 * 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;
 	return 0;
 }
 }