diff options
| author | Peter Wemm <peter@FreeBSD.org> | 2000-01-23 14:41:04 +0000 |
|---|---|---|
| committer | Peter Wemm <peter@FreeBSD.org> | 2000-01-23 14:41:04 +0000 |
| commit | 0f063508d7212aacd287ee0f19a6a1a2f9153fe7 (patch) | |
| tree | b8838a08c5aba14e1811b518ffb2a027dddbc858 /sys/dev/ppbus/lpt.c | |
| parent | 37973e862dd6ad2081d02af953d34c255cf88b20 (diff) | |
Notes
Diffstat (limited to 'sys/dev/ppbus/lpt.c')
| -rw-r--r-- | sys/dev/ppbus/lpt.c | 49 |
1 files changed, 21 insertions, 28 deletions
diff --git a/sys/dev/ppbus/lpt.c b/sys/dev/ppbus/lpt.c index f652a81460731..671ae6ab47e8d 100644 --- a/sys/dev/ppbus/lpt.c +++ b/sys/dev/ppbus/lpt.c @@ -60,11 +60,6 @@ * Updated for ppbus by Nicolas Souchu * [Mon Jul 28 1997] */ -#include "lpt.h" - -#if NLPT > 0 - -#ifdef _KERNEL #include "opt_lpt.h" @@ -84,7 +79,6 @@ #include <sys/rman.h> #include <machine/lpt.h> -#endif #include <dev/ppbus/ppbconf.h> #include <dev/ppbus/ppb_1284.h> @@ -156,27 +150,11 @@ static int lpt_detect(device_t dev); #define UNITODEVICE(unit) \ (devclass_get_device(lpt_devclass, (unit))) -static int lpt_probe(device_t dev); -static int lpt_attach(device_t dev); - static void lptintr(device_t dev); static void lpt_intr(void *arg); /* without spls */ static devclass_t lpt_devclass; -static device_method_t lpt_methods[] = { - /* device interface */ - DEVMETHOD(device_probe, lpt_probe), - DEVMETHOD(device_attach, lpt_attach), - - { 0, 0 } -}; - -static driver_t lpt_driver = { - "lpt", - lpt_methods, - sizeof(struct lpt_data), -}; /* bits for state */ #define OPEN (1<<0) /* device is open */ @@ -365,6 +343,13 @@ end_probe: return (status); } +static void +lpt_identify(driver_t *driver, device_t parent) +{ + + BUS_ADD_CHILD(parent, 0, LPT_NAME, 0); +} + /* * lpt_probe() */ @@ -372,11 +357,7 @@ static int lpt_probe(device_t dev) { struct lpt_data *sc; - static int once; - if (!once++) - cdevsw_add(&lpt_cdevsw); - sc = DEVTOSOFTC(dev); bzero(sc, sizeof(struct lpt_data)); @@ -972,7 +953,19 @@ lptioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) return(error); } -DRIVER_MODULE(lpt, ppbus, lpt_driver, lpt_devclass, 0, 0); +static device_method_t lpt_methods[] = { + /* device interface */ + DEVMETHOD(device_identify, lpt_identify), + DEVMETHOD(device_probe, lpt_probe), + DEVMETHOD(device_attach, lpt_attach), -#endif + { 0, 0 } +}; +static driver_t lpt_driver = { + LPT_NAME, + lpt_methods, + sizeof(struct lpt_data), +}; + +DRIVER_MODULE(lpt, ppbus, lpt_driver, lpt_devclass, 0, 0); |
