diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2009-08-20 20:23:28 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2009-08-20 20:23:28 +0000 |
| commit | 247db0748a75747673b753a6af3e2c39dfae88ed (patch) | |
| tree | fb1ae4beb655a18383d166a5eee425754fb8eeb6 /sys/dev/bktr | |
| parent | 2c68e2fb1e2cb7386b8863b4049198be949161e1 (diff) | |
Notes
Diffstat (limited to 'sys/dev/bktr')
| -rw-r--r-- | sys/dev/bktr/bktr_os.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/dev/bktr/bktr_os.c b/sys/dev/bktr/bktr_os.c index 1fd458cd3c10..327c4bbdb959 100644 --- a/sys/dev/bktr/bktr_os.c +++ b/sys/dev/bktr/bktr_os.c @@ -597,9 +597,7 @@ bktr_open( struct cdev *dev, int flags, int fmt, struct thread *td ) return( ENXIO ); /* Record that the device is now busy */ - newbus_xlock(); device_busy(devclass_get_device(bktr_devclass, unit)); - newbus_xunlock(); if (bt848_card != -1) { @@ -670,11 +668,8 @@ bktr_open( struct cdev *dev, int flags, int fmt, struct thread *td ) } /* If there was an error opening the device, undo the busy status */ - if (result != 0) { - newbus_xlock(); + if (result != 0) device_unbusy(devclass_get_device(bktr_devclass, unit)); - newbus_xunlock(); - } return( result ); } @@ -694,7 +689,6 @@ bktr_close( struct cdev *dev, int flags, int fmt, struct thread *td ) /* Get the device data */ bktr = (struct bktr_softc*)devclass_get_softc(bktr_devclass, unit); if (bktr == NULL) { - /* the device is no longer valid/functioning */ return (ENXIO); } @@ -711,11 +705,10 @@ bktr_close( struct cdev *dev, int flags, int fmt, struct thread *td ) break; default: return (ENXIO); + break; } - newbus_xlock(); device_unbusy(devclass_get_device(bktr_devclass, unit)); - newbus_xunlock(); return( result ); } |
