From 6ea671a12f66b9d4d0f35fce957a71a6849295f2 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 21 Mar 2006 23:20:27 -0800 Subject: [PATCH] [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 Acked-by: Benjamin Herrenschmidt Signed-off-by: Andrew Morton Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/of_device.c | 5 +---- drivers/macintosh/smu.c | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c index 22d83d4d1a..9feeeef5a8 100644 --- a/arch/powerpc/kernel/of_device.c +++ b/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 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) diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index db2ae71d07..4eb05d7143 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c @@ -629,8 +629,6 @@ static struct of_platform_driver smu_of_platform_driver = 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 @@ -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 * 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; } -- 2.39.5