diff options
author | jhb <jhb@FreeBSD.org> | 2006-06-21 17:48:03 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2006-06-21 17:48:03 +0000 |
commit | 32a6c3d3d5b12aedaf29422a64e5406515692329 (patch) | |
tree | 86c813596488c63da997d4f8e424edb6e00e905e /sys | |
parent | 2c4ca6adca3f28ae070727d257eb33e2a5d17b82 (diff) | |
download | FreeBSD-src-32a6c3d3d5b12aedaf29422a64e5406515692329.zip FreeBSD-src-32a6c3d3d5b12aedaf29422a64e5406515692329.tar.gz |
Fix two comments and a style fix.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_linker.c | 10 | ||||
-rw-r--r-- | sys/kern/subr_bus.c | 26 |
2 files changed, 25 insertions, 11 deletions
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index a6f8f27..e9cbff1 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -302,7 +302,7 @@ linker_file_register_modules(linker_file_t lf) " in %s\n", lf->filename)); if (linker_file_lookup_set(lf, "modmetadata_set", &start, - &stop, 0) != 0) { + &stop, NULL) != 0) { /* * This fallback should be unnecessary, but if we get booted * from boot2 instead of loader and we are missing our @@ -645,7 +645,9 @@ linker_file_add_dependency(linker_file_t file, linker_file_t dep) /* * Locate a linker set and its contents. This is a helper function to avoid - * linker_if.h exposure elsewhere. Note: firstp and lastp are really void *** + * linker_if.h exposure elsewhere. Note: firstp and lastp are really void **. + * This function is used in this file so we can avoid having lots of (void **) + * casts. */ int linker_file_lookup_set(linker_file_t file, const char *name, @@ -818,8 +820,8 @@ kern_kldload(struct thread *td, const char *file, int *fileid) return (error); /* - * If file does not contain qualified name or any dot in it - * (kldname.ko, or kldname.ver.ko) treat it as interface + * If file does not contain a qualified name or any dot in it + * (kldname.ko, or kldname.ver.ko) treat it as an interface * name. */ if (index(file, '/') || index(file, '.')) { diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 44dcd47..a09f187 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -826,6 +826,19 @@ devclass_find(const char *classname) return (devclass_find_internal(classname, 0, FALSE)); } +/* + * Call BUS_DRIVER_ADDED for any existing busses in this class. + */ +static void +devclass_driver_added(devclass_t dc, driver_t *driver) +{ + int i; + + for (i = 0; i < dc->maxunit; i++) + if (dc->devices[i]) + BUS_DRIVER_ADDED(dc->devices[i], driver); +} + /** * @brief Add a device driver to a device class * @@ -841,7 +854,6 @@ int devclass_add_driver(devclass_t dc, driver_t *driver) { driverlink_t dl; - int i; PDEBUG(("%s", DRIVERNAME(driver))); @@ -866,12 +878,7 @@ devclass_add_driver(devclass_t dc, driver_t *driver) TAILQ_INSERT_TAIL(&dc->drivers, dl, link); driver->refs++; /* XXX: kobj_mtx */ - /* - * Call BUS_DRIVER_ADDED for any existing busses in this class. - */ - for (i = 0; i < dc->maxunit; i++) - if (dc->devices[i]) - BUS_DRIVER_ADDED(dc->devices[i], driver); + devclass_driver_added(dc, driver); bus_data_generation_update(); return (0); @@ -3754,6 +3761,11 @@ driver_module_handler(module_t mod, int what, void *arg) break; /* + * XXX: Need to find all the device classes whose parent + * is bus_devclass. Not only that, it has to be recursive. + */ + + /* * If the driver has any base classes, make the * devclass inherit from the devclass of the driver's * first base class. This will allow the system to |