diff options
| author | Ed Schouten <ed@FreeBSD.org> | 2009-04-14 14:02:43 +0000 |
|---|---|---|
| committer | Ed Schouten <ed@FreeBSD.org> | 2009-04-14 14:02:43 +0000 |
| commit | 0de5b9b0f0d7237d1d5043843a55516bd1844ece (patch) | |
| tree | ad681a6801c248d4c4f72efa174f837aed3b4f8f /sys/dev | |
| parent | 907859721048646fe50d114391a2bbe5a664d97d (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/twa/tw_osl_freebsd.c | 6 | ||||
| -rw-r--r-- | sys/dev/twe/twe_freebsd.c | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/sys/dev/twa/tw_osl_freebsd.c b/sys/dev/twa/tw_osl_freebsd.c index 85b3af1c5962..f435c2c3d969 100644 --- a/sys/dev/twa/tw_osl_freebsd.c +++ b/sys/dev/twa/tw_osl_freebsd.c @@ -88,8 +88,7 @@ static devclass_t twa_devclass; static TW_INT32 twa_open(struct cdev *dev, TW_INT32 flags, TW_INT32 fmt, d_thread_t *proc) { - TW_INT32 unit = dev2unit(dev); - struct twa_softc *sc = devclass_get_softc(twa_devclass, unit); + struct twa_softc *sc = (struct twa_softc *)(dev->si_drv1); tw_osli_dbg_dprintf(5, sc, "entered"); sc->state |= TW_OSLI_CTLR_STATE_OPEN; @@ -114,8 +113,7 @@ twa_open(struct cdev *dev, TW_INT32 flags, TW_INT32 fmt, d_thread_t *proc) static TW_INT32 twa_close(struct cdev *dev, TW_INT32 flags, TW_INT32 fmt, d_thread_t *proc) { - TW_INT32 unit = dev2unit(dev); - struct twa_softc *sc = devclass_get_softc(twa_devclass, unit); + struct twa_softc *sc = (struct twa_softc *)(dev->si_drv1); tw_osli_dbg_dprintf(5, sc, "entered"); sc->state &= ~TW_OSLI_CTLR_STATE_OPEN; diff --git a/sys/dev/twe/twe_freebsd.c b/sys/dev/twe/twe_freebsd.c index d5e794abd753..6a99864456e0 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); |
