IDE CD Changer: Door Lock Fix (2.1.125)

Chip Salzenberg (chip@perlsupport.com)
Wed, 21 Oct 1998 18:56:57 -0400


The IDE CD support leaves CDs in CD changers locked even after they're
no longer selected. Here's a fix that unlocks CDs when new CDs are
selected.

If this is not the right behavior, please let me know...

Index: drivers/block/ide-cd.c
*************** int ide_cdrom_select_disc (struct cdrom_
*** 2601,2604 ****
--- 2601,2606 ----
}
else {
+ int was_locked;
+
if (
#if ! STANDARD_ATAPI
*************** int ide_cdrom_select_disc (struct cdrom_
*** 2609,2612 ****
--- 2611,2618 ----
}

+ was_locked = CDROM_STATE_FLAGS (drive)->door_locked;
+ if (was_locked)
+ (void) cdrom_lockdoor (drive, 0, NULL);
+
stat = cdrom_load_unload (drive, slot, NULL);
cdrom_saw_media_change (drive);
*************** int ide_cdrom_select_disc (struct cdrom_
*** 2622,2629 ****
if (stat)
return stat;
- return slot;
}
! else
! return stat;
}
}
--- 2628,2637 ----
if (stat)
return stat;
}
!
! if (was_locked)
! (void) cdrom_lockdoor (drive, 1, NULL);
!
! return stat;
}
}

-- 
Chip Salzenberg               - a.k.a. -              <chip@perlsupport.com>
 "... under cover of afternoon in the biggest car in the county?!" //MST3K

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/