Commit f209d8ed authored by Damien Le Moal's avatar Damien Le Moal

ata: libata: Rename ata_dma_blacklisted()

Rename the function ata_dma_blacklisted() to ata_dev_nodma() as this new
name is more neutral. The function signature is also changed to return a
boolean instead of an int.
Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
Reviewed-by: default avatarIgor Pylypiv <ipylypiv@google.com>
Reviewed-by: default avatarNiklas Cassel <cassel@kernel.org>
parent f8f26f74
...@@ -4287,16 +4287,17 @@ static unsigned long ata_dev_blacklisted(const struct ata_device *dev) ...@@ -4287,16 +4287,17 @@ static unsigned long ata_dev_blacklisted(const struct ata_device *dev)
return 0; return 0;
} }
static int ata_dma_blacklisted(const struct ata_device *dev) static bool ata_dev_nodma(const struct ata_device *dev)
{ {
/* We don't support polling DMA. /*
* DMA blacklist those ATAPI devices with CDB-intr (and use PIO) * We do not support polling DMA. Deny DMA for those ATAPI devices
* if the LLDD handles only interrupts in the HSM_ST_LAST state. * with CDB-intr (and use PIO) if the LLDD handles only interrupts in
* the HSM_ST_LAST state.
*/ */
if ((dev->link->ap->flags & ATA_FLAG_PIO_POLLING) && if ((dev->link->ap->flags & ATA_FLAG_PIO_POLLING) &&
(dev->flags & ATA_DFLAG_CDB_INTR)) (dev->flags & ATA_DFLAG_CDB_INTR))
return 1; return true;
return (dev->horkage & ATA_HORKAGE_NODMA) ? 1 : 0; return dev->horkage & ATA_HORKAGE_NODMA;
} }
/** /**
...@@ -4404,10 +4405,10 @@ static void ata_dev_xfermask(struct ata_device *dev) ...@@ -4404,10 +4405,10 @@ static void ata_dev_xfermask(struct ata_device *dev)
xfer_mask &= ~(0x03 << (ATA_SHIFT_MWDMA + 3)); xfer_mask &= ~(0x03 << (ATA_SHIFT_MWDMA + 3));
} }
if (ata_dma_blacklisted(dev)) { if (ata_dev_nodma(dev)) {
xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
ata_dev_warn(dev, ata_dev_warn(dev,
"device is on DMA blacklist, disabling DMA\n"); "device does not support DMA, disabling DMA\n");
} }
if ((host->flags & ATA_HOST_SIMPLEX) && if ((host->flags & ATA_HOST_SIMPLEX) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment