summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_conf.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-05-09 13:00:50 +0000
committerphk <phk@FreeBSD.org>1999-05-09 13:00:50 +0000
commite05bc3b49a62c15237c5647caa75821e3355e91d (patch)
treec5c673ce4e60f5ce4f05e870c615d1b9f1150619 /sys/kern/kern_conf.c
parent7d04d621267e45d230142f9f342d01744819ec08 (diff)
downloadFreeBSD-src-e05bc3b49a62c15237c5647caa75821e3355e91d.zip
FreeBSD-src-e05bc3b49a62c15237c5647caa75821e3355e91d.tar.gz
Unconfuse DEV_MODULE() and DEV_DRIVER_MODULE() about the difference between
a major number for a dev_t.
Diffstat (limited to 'sys/kern/kern_conf.c')
-rw-r--r--sys/kern/kern_conf.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index 13952c3..c20e2aa 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_conf.c,v 1.34 1999/05/09 08:10:17 peter Exp $
+ * $Id: kern_conf.c,v 1.35 1999/05/09 08:18:12 phk Exp $
*/
#include <sys/param.h>
@@ -123,12 +123,21 @@ devsw_module_handler(module_t mod, int what, void* arg)
struct devsw_module_data* data = (struct devsw_module_data*) arg;
int error;
+ if (data->cmaj == NOMAJ)
+ data->cdev = NODEV;
+ else
+ data->cdev = makedev(data->cmaj, 0);
switch (what) {
case MOD_LOAD:
error = cdevsw_add(&data->cdev, data->cdevsw, NULL);
if (!error && data->cdevsw->d_strategy != nostrategy) {
- if (data->bdev == NODEV)
+ if (data->bmaj == NOMAJ) {
data->bdev = data->cdev;
+ data->bmaj = data->cmaj;
+ } else {
+ data->bdev = makedev(data->bmaj, 0);
+ }
+ data->cdevsw->d_maj = data->bmaj;
bmaj2cmaj[major(data->bdev)] = major(data->cdev);
}
if (!error && data->chainevh)
OpenPOWER on IntegriCloud