usb_disk: accept B_DEV_MEDIA_CHANGED as a ready unit.

This commit is contained in:
Jérôme Duval
2013-11-17 18:13:51 +01:00
parent bca4535239
commit b38fed9370
@@ -799,7 +799,8 @@ usb_disk_device_added(usb_device newDevice, void **cookie)
TRACE("usb lun %"B_PRIu8" inquiry attempt %"B_PRIu32" begin\n", TRACE("usb lun %"B_PRIu8" inquiry attempt %"B_PRIu32" begin\n",
i, tries); i, tries);
status_t ready = usb_disk_test_unit_ready(lun, &action); status_t ready = usb_disk_test_unit_ready(lun, &action);
if (ready == B_OK || ready == B_DEV_NO_MEDIA) { if (ready == B_OK || ready == B_DEV_NO_MEDIA
|| ready == B_DEV_MEDIA_CHANGED) {
if (lun->device_type == B_CD) if (lun->device_type == B_CD)
lun->write_protected = true; lun->write_protected = true;
// TODO: check for write protection; disabled since some // TODO: check for write protection; disabled since some