From e47f61e18396b6e5f61ee91b9f9f832976ee96cf Mon Sep 17 00:00:00 2001 From: phk Date: Sat, 2 Sep 2000 19:17:34 +0000 Subject: Avoid the modules madness I inadvertently introduced by making the cloning infrastructure standard in kern_conf. Modules are now the same with or without devfs support. If you need to detect if devfs is present, in modules or elsewhere, check the integer variable "devfs_present". This happily removes an ugly hack from kern/vfs_conf.c. This forces a rename of the eventhandler and the standard clone helper function. Include in : it's a helper #include like Remove all #includes of opt_devfs.h they no longer matter. --- sys/dev/fdc/fdc.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'sys/dev/fdc/fdc.c') diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index dd513e9..c4b6a3c 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -52,7 +52,6 @@ */ #include "opt_fdc.h" -#include "opt_devfs.h" #include "card.h" #include @@ -84,12 +83,6 @@ #include #include -#ifdef DEVFS -#include -#include -#include -#endif - /* misuse a flag to identify format operation */ /* configuration flags */ @@ -952,7 +945,6 @@ DRIVER_MODULE(fdc, pccard, fdc_pccard_driver, fdc_devclass, 0, 0); #endif /* NCARD > 0 */ -#ifdef DEVFS static void fd_clone __P((void *arg, char *name, int namelen, dev_t *dev)); static struct { @@ -993,7 +985,7 @@ fd_clone(arg, name, namelen, dev) if (*dev != NODEV) return; - if (devfs_stdclone(name, &n, "fd", &u) != 2) + if (dev_stdclone(name, &n, "fd", &u) != 2) return; for (i = 0; ; i++) { if (fd_suffix[i].match == NULL) @@ -1011,7 +1003,6 @@ fd_clone(arg, name, namelen, dev) *dev = make_dev_alias(pdev, name); } } -#endif /******************************************************************/ /* @@ -1163,20 +1154,15 @@ static int fd_attach(device_t dev) { struct fd_data *fd; + static int cdevsw_add_done = 0; fd = device_get_softc(dev); -#ifndef DEVFS - { - static int cdevsw_add_done = 0; if (!cdevsw_add_done) { - cdevsw_add(&fd_cdevsw); /* XXX */ - cdevsw_add_done++; - } + cdevsw_add(&fd_cdevsw); /* XXX */ + cdevsw_add_done++; } -#else - EVENTHANDLER_REGISTER(devfs_clone, fd_clone, 0, 1000); -#endif + EVENTHANDLER_REGISTER(dev_clone, fd_clone, 0, 1000); make_dev(&fd_cdevsw, (fd->fdu << 6), UID_ROOT, GID_OPERATOR, 0640, "fd%d", fd->fdu); -- cgit v1.1