mtd: use MTD_OPS_PLACE_OOB macro consistently
authorHuang Shijie <b32955@freescale.com>
Tue, 3 Jul 2012 08:44:14 +0000 (16:44 +0800)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 16 Jul 2012 20:43:17 +0000 (21:43 +0100)
Use the MTD_OPS_PLACE_OOB to replace the hard code "0".
Make the code more readable.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/nand_base.c

index 98ba46ecd5d85e082f80bf92c26ce2f2351c9717..ead301a455ee8784caa7002c633000b1bb4d913c 100644 (file)
@@ -1625,7 +1625,7 @@ static int nand_read(struct mtd_info *mtd, loff_t from, size_t len,
        ops.len = len;
        ops.datbuf = buf;
        ops.oobbuf = NULL;
-       ops.mode = 0;
+       ops.mode = MTD_OPS_PLACE_OOB;
        ret = nand_do_read_ops(mtd, from, &ops);
        *retlen = ops.retlen;
        nand_release_device(mtd);
@@ -2331,7 +2331,7 @@ static int panic_nand_write(struct mtd_info *mtd, loff_t to, size_t len,
        ops.len = len;
        ops.datbuf = (uint8_t *)buf;
        ops.oobbuf = NULL;
-       ops.mode = 0;
+       ops.mode = MTD_OPS_PLACE_OOB;
 
        ret = nand_do_write_ops(mtd, to, &ops);
 
@@ -2360,7 +2360,7 @@ static int nand_write(struct mtd_info *mtd, loff_t to, size_t len,
        ops.len = len;
        ops.datbuf = (uint8_t *)buf;
        ops.oobbuf = NULL;
-       ops.mode = 0;
+       ops.mode = MTD_OPS_PLACE_OOB;
        ret = nand_do_write_ops(mtd, to, &ops);
        *retlen = ops.retlen;
        nand_release_device(mtd);