[MTD] [NOR] Intel: remove ugly PROGREGION macros

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Feb 9 10:59:03 EST 2007


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=d416085572eb6a44fd2cf29fd7aed83ffc95fd88
Commit:     d416085572eb6a44fd2cf29fd7aed83ffc95fd88
Parent:     992c9d24c417afce9792da18f8e664c6b9802c5c
Author:     Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
AuthorDate: Tue Jan 30 10:45:55 2007 +0200
Committer:  David Woodhouse <dwmw2 at infradead.org>
CommitDate: Fri Feb 9 15:26:37 2007 +0000

    [MTD] [NOR] Intel: remove ugly PROGREGION macros
    
    Remove ugly and weird MTD_PROGREGION_CTRLMODE_VALID() and
    MTD_PROGREGION_CTRLMODE_INVALID() macros. There is only one
    user of them and they are used locally just for printing.
    
    Anyway, this patch is a preparation for removing mtd->ecctype
    and mtd->eccsize, but these macros use them. Fix this.
    
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
---
 drivers/mtd/chips/cfi_cmdset_0001.c |    6 ++----
 include/linux/mtd/mtd.h             |   10 ----------
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index d402625..f334959 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -560,13 +560,11 @@ static int cfi_intelext_partition_fixup(struct mtd_info *mtd,
 			struct cfi_intelext_programming_regioninfo *prinfo;
 			prinfo = (struct cfi_intelext_programming_regioninfo *)&extp->extra[offs];
 			mtd->writesize = cfi->interleave << prinfo->ProgRegShift;
-			MTD_PROGREGION_CTRLMODE_VALID(mtd) = cfi->interleave * prinfo->ControlValid;
-			MTD_PROGREGION_CTRLMODE_INVALID(mtd) = cfi->interleave * prinfo->ControlInvalid;
 			mtd->flags &= ~MTD_BIT_WRITEABLE;
 			printk(KERN_DEBUG "%s: program region size/ctrl_valid/ctrl_inval = %d/%d/%d\n",
 			       map->name, mtd->writesize,
-			       MTD_PROGREGION_CTRLMODE_VALID(mtd),
-			       MTD_PROGREGION_CTRLMODE_INVALID(mtd));
+			       cfi->interleave * prinfo->ControlValid,
+			       cfi->interleave * prinfo->ControlInvalid);
 		}
 
 		/*
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index d644e57..afab253 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -120,16 +120,6 @@ struct mtd_info {
 	u_int32_t ecctype;
 	u_int32_t eccsize;
 
-	/*
-	 * Reuse some of the above unused fields in the case of NOR flash
-	 * with configurable programming regions to avoid modifying the
-	 * user visible structure layout/size.  Only valid when the
-	 * MTD_PROGRAM_REGIONS flag is set.
-	 * (Maybe we should have an union for those?)
-	 */
-#define MTD_PROGREGION_CTRLMODE_VALID(mtd)  (mtd)->oobsize
-#define MTD_PROGREGION_CTRLMODE_INVALID(mtd)  (mtd)->ecctype
-
 	// Kernel-only stuff starts here.
 	char *name;
 	int index;



More information about the linux-mtd-cvs mailing list