summaryrefslogtreecommitdiffstats
path: root/sys/dev/fdc
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2000-09-02 19:17:34 +0000
committerphk <phk@FreeBSD.org>2000-09-02 19:17:34 +0000
commite47f61e18396b6e5f61ee91b9f9f832976ee96cf (patch)
treebc17f23dc3fa3b9663516bac048049a5f02652ea /sys/dev/fdc
parent0ab175f21b9e105fcbe4db6569019e946f23e13c (diff)
downloadFreeBSD-src-e47f61e18396b6e5f61ee91b9f9f832976ee96cf.zip
FreeBSD-src-e47f61e18396b6e5f61ee91b9f9f832976ee96cf.tar.gz
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 <sys/eventhandler.h> in <sys/conf.h>: it's a helper #include like <sys/queue.h> Remove all #includes of opt_devfs.h they no longer matter.
Diffstat (limited to 'sys/dev/fdc')
-rw-r--r--sys/dev/fdc/fdc.c24
1 files changed, 5 insertions, 19 deletions
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 <sys/param.h>
@@ -84,12 +83,6 @@
#include <isa/fdc.h>
#include <isa/rtc.h>
-#ifdef DEVFS
-#include <sys/ctype.h>
-#include <sys/eventhandler.h>
-#include <fs/devfs/devfs.h>
-#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);
OpenPOWER on IntegriCloud