mtd: nand: use NAND_HAS_CACHEPROG

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Apr 5 08:59:03 EDT 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=3239a6cdef0be60ec2dadc501cf385dc419d7452
Commit:     3239a6cdef0be60ec2dadc501cf385dc419d7452
Parent:     88ad4b162adb3821815d0098987040fca26c7d80
Author:     Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
AuthorDate: Mon Mar 4 14:56:18 2013 +0200
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Apr 5 12:02:19 2013 +0100

    mtd: nand: use NAND_HAS_CACHEPROG
    
    We have this unused macro, let's use it and justify its existence.
    
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Acked-by: Brian Norris <computersforpeace at gmail.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/nand_base.c | 2 +-
 include/linux/mtd/nand.h     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 39154aa..11ee9d4 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2059,7 +2059,7 @@ static int nand_write_page(struct mtd_info *mtd, struct nand_chip *chip,
 	 */
 	cached = 0;
 
-	if (!cached || !(chip->options & NAND_CACHEPRG)) {
+	if (!cached || !NAND_HAS_CACHEPROG(chip)) {
 
 		chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);
 		status = chip->waitfunc(mtd, chip);
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index ec0a748..07d7a3d 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -167,7 +167,7 @@ typedef enum {
 #define NAND_SUBPAGE_READ	0x00001000
 
 /* Options valid for Samsung large page devices */
-#define NAND_SAMSUNG_LP_OPTIONS (NAND_CACHEPRG)
+#define NAND_SAMSUNG_LP_OPTIONS NAND_CACHEPRG
 
 /* Macros to identify the above */
 #define NAND_HAS_CACHEPROG(chip) ((chip->options & NAND_CACHEPRG))



More information about the linux-mtd-cvs mailing list