diff options
| author | Andrew Thompson <thompsa@FreeBSD.org> | 2009-10-29 23:09:37 +0000 |
|---|---|---|
| committer | Andrew Thompson <thompsa@FreeBSD.org> | 2009-10-29 23:09:37 +0000 |
| commit | 9fd6caea707788cd68a0aa8c545eb45ebf150ec3 (patch) | |
| tree | 8dac8cdf63e1524ce2b3213a26d93ec0bf62f7e4 /sys | |
| parent | 61908699b5da2c8e05b4d62203f8457986e911de (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/dev/usb/misc/ufm.c | 15 | ||||
| -rw-r--r-- | sys/dev/usb/storage/urio.c | 3 |
2 files changed, 4 insertions, 14 deletions
diff --git a/sys/dev/usb/misc/ufm.c b/sys/dev/usb/misc/ufm.c index c10166a5bf0e..136182a1c3e3 100644 --- a/sys/dev/usb/misc/ufm.c +++ b/sys/dev/usb/misc/ufm.c @@ -86,11 +86,9 @@ static device_attach_t ufm_attach; static device_detach_t ufm_detach; static usb_fifo_ioctl_t ufm_ioctl; -static usb_fifo_open_t ufm_open; static struct usb_fifo_methods ufm_fifo_methods = { .f_ioctl = &ufm_ioctl, - .f_open = &ufm_open, .basename[0] = "ufm", }; @@ -179,15 +177,6 @@ ufm_detach(device_t dev) } static int -ufm_open(struct usb_fifo *dev, int fflags) -{ - if ((fflags & (FWRITE | FREAD)) != (FWRITE | FREAD)) { - return (EACCES); - } - return (0); -} - -static int ufm_do_req(struct ufm_softc *sc, uint8_t request, uint16_t value, uint16_t index, uint8_t *retbuf) { @@ -315,6 +304,10 @@ ufm_ioctl(struct usb_fifo *fifo, u_long cmd, void *addr, struct ufm_softc *sc = usb_fifo_softc(fifo); int error = 0; + if ((fflags & (FWRITE | FREAD)) != (FWRITE | FREAD)) { + return (EACCES); + } + switch (cmd) { case FM_SET_FREQ: error = ufm_set_freq(sc, addr); diff --git a/sys/dev/usb/storage/urio.c b/sys/dev/usb/storage/urio.c index 6bb2e889e405..403c4c2b216a 100644 --- a/sys/dev/usb/storage/urio.c +++ b/sys/dev/usb/storage/urio.c @@ -390,9 +390,6 @@ urio_open(struct usb_fifo *fifo, int fflags) { struct urio_softc *sc = usb_fifo_softc(fifo); - if ((fflags & (FWRITE | FREAD)) != (FWRITE | FREAD)) { - return (EACCES); - } if (fflags & FREAD) { /* clear stall first */ mtx_lock(&sc->sc_mtx); |
