Skip to content

Commit d4bba15

Browse files
David Reganmiquelraynal
authored andcommitted
mtd: rawnand: brcmnand: exec_op helper functions return type fixes
Fix return types for exec_op reset and status helper functions. Reported-by: Dan Carpenter <[email protected]> Closes: http://lists.infradead.org/pipermail/linux-mtd/2023-December/102423.html Fixes: 3c8260c ("mtd: rawnand: brcmnand: exec_op implementation") Signed-off-by: David Regan <[email protected]> Signed-off-by: William Zhang <[email protected]> Reviewed-by: William Zhang <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 0bfad3b commit d4bba15

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/mtd/nand/raw/brcmnand/brcmnand.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ enum {
625625
/* Only for v7.2 */
626626
#define ACC_CONTROL_ECC_EXT_SHIFT 13
627627

628-
static u8 brcmnand_status(struct brcmnand_host *host);
628+
static int brcmnand_status(struct brcmnand_host *host);
629629

630630
static inline bool brcmnand_non_mmio_ops(struct brcmnand_controller *ctrl)
631631
{
@@ -1690,7 +1690,7 @@ static int brcmnand_waitfunc(struct nand_chip *chip)
16901690
INTFC_FLASH_STATUS;
16911691
}
16921692

1693-
static u8 brcmnand_status(struct brcmnand_host *host)
1693+
static int brcmnand_status(struct brcmnand_host *host)
16941694
{
16951695
struct nand_chip *chip = &host->chip;
16961696
struct mtd_info *mtd = nand_to_mtd(chip);
@@ -1701,7 +1701,7 @@ static u8 brcmnand_status(struct brcmnand_host *host)
17011701
return brcmnand_waitfunc(chip);
17021702
}
17031703

1704-
static u8 brcmnand_reset(struct brcmnand_host *host)
1704+
static int brcmnand_reset(struct brcmnand_host *host)
17051705
{
17061706
struct nand_chip *chip = &host->chip;
17071707

@@ -2433,7 +2433,11 @@ static int brcmnand_exec_op(struct nand_chip *chip,
24332433

24342434
if (brcmnand_op_is_status(op)) {
24352435
status = op->instrs[1].ctx.data.buf.in;
2436-
*status = brcmnand_status(host);
2436+
ret = brcmnand_status(host);
2437+
if (ret < 0)
2438+
return ret;
2439+
2440+
*status = ret & 0xFF;
24372441

24382442
return 0;
24392443
}

0 commit comments

Comments
 (0)