mirror of
https://gitee.com/open-loongarch/linux-6.12.git
synced 2026-10-25 12:37:11 +08:00
ata: libata: Improve return value of atapi_check_dma()
atapi_check_dma() allows a LLD to filter ATAPI commands, returning a status indicating whether or not it is OK to use DMA for the supplied ATAPI command. Change atapi_check_dma() to return -EOPNOTSUPP instead of 1 for an ATAPI command that is not allowed to use DMA. Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Link: https://lore.kernel.org/r/20250312133954.6666-1-chenhuacai@loongson.cn [cassel: improve commit log] Signed-off-by: Niklas Cassel <cassel@kernel.org> Signed-off-by: maoxiaochuan <maoxiaochuan@loongson.cn>
This commit is contained in:
committed by
maoxiaochuan
parent
a3d4bda8ab
commit
4e8b49b325
@@ -4544,7 +4544,7 @@ int atapi_check_dma(struct ata_queued_cmd *qc)
|
|||||||
*/
|
*/
|
||||||
if (!(qc->dev->quirks & ATA_QUIRK_ATAPI_MOD16_DMA) &&
|
if (!(qc->dev->quirks & ATA_QUIRK_ATAPI_MOD16_DMA) &&
|
||||||
unlikely(qc->nbytes & 15))
|
unlikely(qc->nbytes & 15))
|
||||||
return 1;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
if (ap->ops->check_atapi_dma)
|
if (ap->ops->check_atapi_dma)
|
||||||
return ap->ops->check_atapi_dma(qc);
|
return ap->ops->check_atapi_dma(qc);
|
||||||
|
|||||||
Reference in New Issue
Block a user