]> Gentwo Git Trees - linux/.git/commitdiff
mfd: qnap-mcu: Use EPROTO in stead of EIO on checksum errors
authorHeiko Stuebner <heiko@sntech.de>
Thu, 13 Nov 2025 16:52:16 +0000 (17:52 +0100)
committerLee Jones <lee@kernel.org>
Thu, 20 Nov 2025 10:14:06 +0000 (10:14 +0000)
EPROTO stands for protocol error and a lot of driver already use it
to designate errors in the sent or received data from a peripheral.

So use it in the qnap-mcu as well for checksum errors.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patch.msgid.link/20251113165218.449616-3-heiko@sntech.de
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/qnap-mcu.c

index 4cd5319fc6cb0587f106676fd3c970ed16f50afa..1f4741cad875cb7261f56c73c07c8aa9d2d735ee 100644 (file)
@@ -178,7 +178,7 @@ int qnap_mcu_exec(struct qnap_mcu *mcu,
        crc = qnap_mcu_csum(rx, reply->received - QNAP_MCU_CHECKSUM_SIZE);
        if (crc != rx[reply->received - QNAP_MCU_CHECKSUM_SIZE]) {
                dev_err(&mcu->serdev->dev, "Invalid Checksum received\n");
-               return -EIO;
+               return -EPROTO;
        }
 
        memcpy(reply_data, rx, reply_data_size);