lkml.org 
[lkml]   [2007]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: AGPGart / AMD K7
On Fri, Apr 20, 2007 at 11:29:52AM -0700, Greg Kroah-Hartman wrote:
> On Fri, Apr 20, 2007 at 02:20:29PM -0400, Dave Jones wrote:
> >
> > btw Greg, wtf does driver_register return a 0 as 'success' if it
> > completes the function, and 0 as 'failure' if !bus ?
> > That seems doomed to failure.
>
> I don't know why the code does that, we should always have a bus
> assigned to a driver. I'll change that and watch to see what breaks :)

Maybe this?

We should always have a bus in bus_add_driver()
Instead of returning success when we don't, BUG().

Signed-off-by: Dave Jones <davej@redhat.com>

diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 253868e..3ba8f1f 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -530,8 +530,7 @@ int bus_add_driver(struct device_driver *drv)
struct bus_type * bus = get_bus(drv->bus);
int error = 0;

- if (!bus)
- return 0;
+ BUG_ON(!bus);

pr_debug("bus %s: add driver %s\n", bus->name, drv->name);
error = kobject_set_name(&drv->kobj, "%s", drv->name);
--
http://www.codemonkey.org.uk
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-04-20 21:03    [W:0.125 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site