diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2009-08-20 19:17:53 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2009-08-20 19:17:53 +0000 |
| commit | a56fe095f0d5fb20fc70b784acb0cd2d367d3e79 (patch) | |
| tree | ee9b2a74c07c732ee357d4810494c3b6aecd6e71 /sys/dev/bktr | |
| parent | 497e910cd321dbdc45c010417bb7079365234fcf (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 ); } |
