Skip to content

Commit

Permalink
[MTD] mtd_dataflash: Incorrect compare-after-write check
Browse files Browse the repository at this point in the history
After writing to a Dataflash page, the built-in compare operation is
used to check that the page was successfully written.  A logic bug in
checking the results of the comparison currently causes the compare to
never fail.

This bug was originally in the legacy at91_dataflash.c driver.

Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
Andrew Victor authored and David Woodhouse committed Nov 28, 2007
1 parent c2056e1 commit cccb45d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/devices/mtd_dataflash.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len,
status = dataflash_waitready(priv->spi);

/* Check result of the compare operation */
if ((status & (1 << 6)) == 1) {
if (status & (1 << 6)) {
printk(KERN_ERR "%s: compare page %u, err %d\n",
spi->dev.bus_id, pageaddr, status);
remaining = 0;
Expand Down

0 comments on commit cccb45d

Please sign in to comment.