diff options
| author | Ed Schouten <ed@FreeBSD.org> | 2009-04-18 07:36:38 +0000 |
|---|---|---|
| committer | Ed Schouten <ed@FreeBSD.org> | 2009-04-18 07:36:38 +0000 |
| commit | e78a5a3f2f90c7fa01671cc0684ef1699d312300 (patch) | |
| tree | 816e6534301157fd0f6e6d88f7c04491ba566714 /sys/dev/mly | |
| parent | f4f5e3f5b94437ec79e2982de88847d9a44c0248 (diff) | |
Notes
Diffstat (limited to 'sys/dev/mly')
| -rw-r--r-- | sys/dev/mly/mly.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/mly/mly.c b/sys/dev/mly/mly.c index 2fcaadc2b838..1f61542ba03b 100644 --- a/sys/dev/mly/mly.c +++ b/sys/dev/mly/mly.c @@ -310,7 +310,7 @@ mly_attach(device_t dev) /* * Create the control device. */ - sc->mly_dev_t = make_dev(&mly_cdevsw, device_get_unit(sc->mly_dev), UID_ROOT, GID_OPERATOR, + sc->mly_dev_t = make_dev(&mly_cdevsw, 0, UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR, "mly%d", device_get_unit(sc->mly_dev)); sc->mly_dev_t->si_drv1 = sc; @@ -2834,8 +2834,7 @@ mly_print_controller(int controller) static int mly_user_open(struct cdev *dev, int flags, int fmt, struct thread *td) { - int unit = dev2unit(dev); - struct mly_softc *sc = devclass_get_softc(devclass_find("mly"), unit); + struct mly_softc *sc = dev->si_drv1; sc->mly_state |= MLY_STATE_OPEN; return(0); @@ -2847,8 +2846,7 @@ mly_user_open(struct cdev *dev, int flags, int fmt, struct thread *td) static int mly_user_close(struct cdev *dev, int flags, int fmt, struct thread *td) { - int unit = dev2unit(dev); - struct mly_softc *sc = devclass_get_softc(devclass_find("mly"), unit); + struct mly_softc *sc = dev->si_drv1; sc->mly_state &= ~MLY_STATE_OPEN; return (0); |
