|
|
@@ -1026,7 +1026,11 @@ static void floppy_release(struct gendisk *disk, fmode_t mode)
|
|
|
struct swim3 __iomem *sw = fs->swim3;
|
|
|
|
|
|
mutex_lock(&swim3_mutex);
|
|
|
- if (fs->ref_count > 0 && --fs->ref_count == 0) {
|
|
|
+ if (fs->ref_count > 0)
|
|
|
+ --fs->ref_count;
|
|
|
+ else if (fs->ref_count == -1)
|
|
|
+ fs->ref_count = 0;
|
|
|
+ if (fs->ref_count == 0) {
|
|
|
swim3_action(fs, MOTOR_OFF);
|
|
|
out_8(&sw->control_bic, 0xff);
|
|
|
swim3_select(fs, RELAX);
|