summaryrefslogtreecommitdiffstats
path: root/sys/dev/twe
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/twe')
-rw-r--r--sys/dev/twe/twe_freebsd.c6
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);
OpenPOWER on IntegriCloud