]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ata: libata: Improve return value of atapi_check_dma()
authorHuacai Chen <chenhuacai@loongson.cn>
Wed, 12 Mar 2025 13:39:54 +0000 (21:39 +0800)
committerNiklas Cassel <cassel@kernel.org>
Wed, 12 Mar 2025 15:05:59 +0000 (16:05 +0100)
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>
drivers/ata/libata-core.c

index 9c4a21e5a8bb7953abb37df04009c7ad33fd2acc..193fc3942fd3a9035fd510c73b5d639bb6b50ea1 100644 (file)
@@ -4579,7 +4579,7 @@ int atapi_check_dma(struct ata_queued_cmd *qc)
         */
        if (!(qc->dev->quirks & ATA_QUIRK_ATAPI_MOD16_DMA) &&
            unlikely(qc->nbytes & 15))
-               return 1;
+               return -EOPNOTSUPP;
 
        if (ap->ops->check_atapi_dma)
                return ap->ops->check_atapi_dma(qc);