diff options
| author | Ed Schouten <ed@FreeBSD.org> | 2009-01-25 09:20:59 +0000 |
|---|---|---|
| committer | Ed Schouten <ed@FreeBSD.org> | 2009-01-25 09:20:59 +0000 |
| commit | 8d456252aa78001624aba124b269801a30128116 (patch) | |
| tree | 44f0195e026a01fa66a367f8b019ca89fa516cfc /sys/dev | |
| parent | 748b9df6875f137b9a65ea8d63579e2b855f75e7 (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/speaker/spkr.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c index 8d2ceed1e403f..66fd30293aa52 100644 --- a/sys/dev/speaker/spkr.c +++ b/sys/dev/speaker/spkr.c @@ -419,9 +419,7 @@ spkropen(dev, flags, fmt, td) (void) printf("spkropen: entering with dev = %s\n", devtoname(dev)); #endif /* DEBUG */ - if (dev2unit(dev) != 0) - return(ENXIO); - else if (spkr_active) + if (spkr_active) return(EBUSY); else { #ifdef DEBUG @@ -444,9 +442,8 @@ spkrwrite(dev, uio, ioflag) printf("spkrwrite: entering with dev = %s, count = %d\n", devtoname(dev), uio->uio_resid); #endif /* DEBUG */ - if (dev2unit(dev) != 0) - return(ENXIO); - else if (uio->uio_resid > (DEV_BSIZE - 1)) /* prevent system crashes */ + + if (uio->uio_resid > (DEV_BSIZE - 1)) /* prevent system crashes */ return(E2BIG); else { unsigned n; @@ -475,15 +472,11 @@ spkrclose(dev, flags, fmt, td) (void) printf("spkrclose: entering with dev = %s\n", devtoname(dev)); #endif /* DEBUG */ - if (dev2unit(dev) != 0) - return(ENXIO); - else { - wakeup(&endtone); - wakeup(&endrest); - free(spkr_inbuf, M_SPKR); - spkr_active = FALSE; - return(0); - } + wakeup(&endtone); + wakeup(&endrest); + free(spkr_inbuf, M_SPKR); + spkr_active = FALSE; + return(0); } static int @@ -499,9 +492,7 @@ spkrioctl(dev, cmd, cmdarg, flags, td) devtoname(dev), cmd); #endif /* DEBUG */ - if (dev2unit(dev) != 0) - return(ENXIO); - else if (cmd == SPKRTONE) { + if (cmd == SPKRTONE) { tone_t *tp = (tone_t *)cmdarg; if (tp->frequency == 0) |
