Commit c115add9 authored by Brian Norris's avatar Brian Norris

mtd: nand: denali: set proper error code on timeout

The condition "if (irq_status == 0)" already ensures that one half of
the ternary ?: is dead. I think this should probably actually be a FAIL,
not a PASS.

Caught by Coverity.
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Cc: Jamie Iles <jamie@jamieiles.com>
parent 31f75462
...@@ -1062,9 +1062,7 @@ static int write_page(struct mtd_info *mtd, struct nand_chip *chip, ...@@ -1062,9 +1062,7 @@ static int write_page(struct mtd_info *mtd, struct nand_chip *chip,
dev_err(denali->dev, dev_err(denali->dev,
"timeout on write_page (type = %d)\n", "timeout on write_page (type = %d)\n",
raw_xfer); raw_xfer);
denali->status = denali->status = NAND_STATUS_FAIL;
(irq_status & INTR_STATUS__PROGRAM_FAIL) ?
NAND_STATUS_FAIL : PASS;
} }
denali_enable_dma(denali, false); denali_enable_dma(denali, false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment