]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mtd: use the NAND_STATUS_FAIL to replace the hardcode
authorHuang Shijie <shijie8@gmail.com>
Mon, 15 Oct 2012 03:47:24 +0000 (23:47 -0400)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 9 Nov 2012 15:02:55 +0000 (17:02 +0200)
Use the NAND_STATUS_FAIL to replace the hardcode "0x01",
which make the code more readable.

Signed-off-by: Huang Shijie <shijie8@gmail.com>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drivers/mtd/nand/nand_base.c

index ec6841d8e956f74f5224363392632900a39e1f8e..bb240fce83b5cb93ff83184657e55a0bf465046d 100644 (file)
@@ -899,7 +899,7 @@ static int __nand_unlock(struct mtd_info *mtd, loff_t ofs,
        /* Call wait ready function */
        status = chip->waitfunc(mtd, chip);
        /* See if device thinks it succeeded */
-       if (status & 0x01) {
+       if (status & NAND_STATUS_FAIL) {
                pr_debug("%s: error status = 0x%08x\n",
                                        __func__, status);
                ret = -EIO;
@@ -1004,7 +1004,7 @@ int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
        /* Call wait ready function */
        status = chip->waitfunc(mtd, chip);
        /* See if device thinks it succeeded */
-       if (status & 0x01) {
+       if (status & NAND_STATUS_FAIL) {
                pr_debug("%s: error status = 0x%08x\n",
                                        __func__, status);
                ret = -EIO;