aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/twe/twe_freebsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/twe/twe_freebsd.c')
-rw-r--r--sys/dev/twe/twe_freebsd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/twe/twe_freebsd.c b/sys/dev/twe/twe_freebsd.c
index 7e03883c75d9..d5e794abd753 100644
--- a/sys/dev/twe/twe_freebsd.c
+++ b/sys/dev/twe/twe_freebsd.c
@@ -81,7 +81,7 @@ static struct cdevsw twe_cdevsw = {
static int
twe_open(struct cdev *dev, int flags, int fmt, d_thread_t *td)
{
- int unit = minor(dev);
+ int unit = dev2unit(dev);
struct twe_softc *sc = devclass_get_softc(twe_devclass, unit);
sc->twe_state |= TWE_STATE_OPEN;
@@ -94,7 +94,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 = minor(dev);
+ int unit = dev2unit(dev);
struct twe_softc *sc = devclass_get_softc(twe_devclass, unit);
sc->twe_state &= ~TWE_STATE_OPEN;