diff options
Diffstat (limited to 'sys/dev/ata/atapi-fd.c')
-rw-r--r-- | sys/dev/ata/atapi-fd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/ata/atapi-fd.c b/sys/dev/ata/atapi-fd.c index e9f3021..b8434b3 100644 --- a/sys/dev/ata/atapi-fd.c +++ b/sys/dev/ata/atapi-fd.c @@ -147,11 +147,11 @@ afd_reinit(device_t dev) { struct ata_channel *ch = device_get_softc(device_get_parent(dev)); struct ata_device *atadev = device_get_softc(dev); - - if (((atadev->unit == ATA_MASTER) && !(ch->devices & ATA_ATAPI_MASTER)) || - ((atadev->unit == ATA_SLAVE) && !(ch->devices & ATA_ATAPI_SLAVE))) { + + /* if detach pending, return error */ + if (!(ch->devices & (ATA_ATAPI_MASTER << atadev->unit))) return 1; - } + ATA_SETMODE(device_get_parent(dev), dev); return 0; } |