提交 cccb45d4 编写于 作者: A Andrew Victor 提交者: David Woodhouse

[MTD] mtd_dataflash: Incorrect compare-after-write check

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: NAndrew Victor <andrew@sanpeople.com>
Acked-by: NDavid Brownell <david-b@pacbell.net>
Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
上级 c2056e1e
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册