mfd: qnap-mcu: Use EPROTO in stead of EIO on checksum

A patch from »Improve error handling for qnap-mcu transfers« in state Mainline for linux-kernel

From: Heiko Stuebner <heiko@...> Date: Tue, 16 Sep 2025 12:01:21 +0200

Commit-Message

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@...>

Patch-Comment

drivers/mfd/qnap-mcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Statistics

  • 1 lines added
  • 1 lines removed

Changes

---------------------------- drivers/mfd/qnap-mcu.c ----------------------------
index e3210541ec56..b4b630f7d413 100644
@@ -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);
 
 

Recent Patches

About Us

Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer.

Read More...