diff options
| author | Ed Schouten <ed@FreeBSD.org> | 2009-04-14 11:57:26 +0000 |
|---|---|---|
| committer | Ed Schouten <ed@FreeBSD.org> | 2009-04-14 11:57:26 +0000 |
| commit | 9555aafab29fa9dcc26056209b90677bd0821e8c (patch) | |
| tree | 62dda5c866d677bab9d3205dab6fad822144d97c /sys/dev/tdfx | |
| parent | bab43bab0cbe0739e1fd306829f32201f172989d (diff) | |
Notes
Diffstat (limited to 'sys/dev/tdfx')
| -rw-r--r-- | sys/dev/tdfx/tdfx_pci.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/tdfx/tdfx_pci.c b/sys/dev/tdfx/tdfx_pci.c index 4d12a65fdf4a..08db0857c5a9 100644 --- a/sys/dev/tdfx/tdfx_pci.c +++ b/sys/dev/tdfx/tdfx_pci.c @@ -255,6 +255,7 @@ tdfx_attach(device_t dev) { */ tdfx_info->devt = make_dev(&tdfx_cdev, device_get_unit(dev), UID_ROOT, GID_WHEEL, 0600, "3dfx%x", device_get_unit(dev)); + tdfx_info->devt->si_drv1 = tdfx_info; return 0; } @@ -393,8 +394,7 @@ tdfx_open(struct cdev *dev, int flags, int fmt, struct thread *td) * The open cdev method handles open(2) calls to /dev/3dfx[n] * We can pretty much allow any opening of the device. */ - struct tdfx_softc *tdfx_info = devclass_get_softc(tdfx_devclass, - UNIT(dev2unit(dev))); + struct tdfx_softc *tdfx_info = dev->si_drv1; if(tdfx_info->busy != 0) return EBUSY; #ifdef DEBUG printf("3dfx: Opened by #%d\n", td->td_proc->p_pid); @@ -411,8 +411,7 @@ tdfx_close(struct cdev *dev, int fflag, int devtype, struct thread *td) * The close cdev method handles close(2) calls to /dev/3dfx[n] * We'll always want to close the device when it's called. */ - struct tdfx_softc *tdfx_info = devclass_get_softc(tdfx_devclass, - UNIT(dev2unit(dev))); + struct tdfx_softc *tdfx_info = dev->si_drv1; if(tdfx_info->busy == 0) return EBADF; tdfx_info->busy = 0; #ifdef DEBUG @@ -434,8 +433,7 @@ tdfx_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) /* struct tdfx_softc* tdfx_info; */ /* Get the configuration for our card XXX*/ - /*tdfx_info = (struct tdfx_softc*)devclass_get_softc(tdfx_devclass, - UNIT(dev2unit(dev)));*/ + /*tdfx_info = dev->si_drv1; */ /************************/ struct tdfx_softc* tdfx_info[2]; |
