diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index f0d1cf7b286..2033231df6c 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -932,8 +932,7 @@ ata_atapi(device_t dev) struct ata_channel *ch = device_get_softc(device_get_parent(dev)); struct ata_device *atadev = device_get_softc(dev); - return ((atadev->unit == ATA_MASTER && ch->devices & ATA_ATAPI_MASTER) || - (atadev->unit == ATA_SLAVE && ch->devices & ATA_ATAPI_SLAVE)); + return (ch->devices & (ATA_ATAPI_MASTER << atadev->unit)); } int