diff options
author | ed <ed@FreeBSD.org> | 2009-04-14 14:02:43 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-04-14 14:02:43 +0000 |
commit | 7bada89aea02a7eae90b2d067414afeceeb2c1c9 (patch) | |
tree | ad681a6801c248d4c4f72efa174f837aed3b4f8f /sys/dev/twe | |
parent | 6cef1a6be3d4e0ff2beab816ef245cb623299ac5 (diff) | |
download | FreeBSD-src-7bada89aea02a7eae90b2d067414afeceeb2c1c9.zip FreeBSD-src-7bada89aea02a7eae90b2d067414afeceeb2c1c9.tar.gz |
Use si_drv1 instead of dev2unit() in twe(4) and twa(4)
Reviewed by: scottl
Diffstat (limited to 'sys/dev/twe')
-rw-r--r-- | sys/dev/twe/twe_freebsd.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/twe/twe_freebsd.c b/sys/dev/twe/twe_freebsd.c index d5e794a..6a99864 100644 --- a/sys/dev/twe/twe_freebsd.c +++ b/sys/dev/twe/twe_freebsd.c @@ -81,8 +81,7 @@ static struct cdevsw twe_cdevsw = { static int twe_open(struct cdev *dev, int flags, int fmt, d_thread_t *td) { - int unit = dev2unit(dev); - struct twe_softc *sc = devclass_get_softc(twe_devclass, unit); + struct twe_softc *sc = (struct twe_softc *)dev->si_drv1; sc->twe_state |= TWE_STATE_OPEN; return(0); @@ -94,8 +93,7 @@ twe_open(struct cdev *dev, int flags, int fmt, d_thread_t *td) static int twe_close(struct cdev *dev, int flags, int fmt, d_thread_t *td) { - int unit = dev2unit(dev); - struct twe_softc *sc = devclass_get_softc(twe_devclass, unit); + struct twe_softc *sc = (struct twe_softc *)dev->si_drv1; sc->twe_state &= ~TWE_STATE_OPEN; return (0); |