Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mtd: rawnand: cadence: Fix return type of CDMA send-and-wait helper

cadence_nand_cdma_send_and_wait() propagates negative errno values
from cadence_nand_cdma_send(), returns -ETIMEDOUT on failure and -EIO
when the CDMA engine reports a command failure.

However, it is declared as u32, causing error codes to wrap.
Change the return type to int to correctly propagate errors.

Fixes: ec4ba01e894d ("mtd: rawnand: Add new Cadence NAND driver to MTD subsystem")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

authored by

Alok Tiwari and committed by
Miquel Raynal
6d8226cb a75a1dec

+1 -1
+1 -1
drivers/mtd/nand/raw/cadence-nand-controller.c
··· 1066 1066 } 1067 1067 1068 1068 /* Send SDMA command and wait for finish. */ 1069 - static u32 1069 + static int 1070 1070 cadence_nand_cdma_send_and_wait(struct cdns_nand_ctrl *cdns_ctrl, 1071 1071 u8 thread) 1072 1072 {