NAND: Rename DEBUG to MTDDEBUG to avoid namespace pollution.
[kernel/u-boot.git] / include / linux / mtd / mtd.h
index 9ef4cce..05ba375 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * $Id: mtd.h,v 1.56 2004/08/09 18:46:04 dmarlin Exp $
  *
  * Copyright (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> et al.
@@ -13,7 +13,7 @@
 
 #define MAX_MTD_DEVICES 16
 
-#define MTD_ERASE_PENDING              0x01
+#define MTD_ERASE_PENDING      0x01
 #define MTD_ERASING            0x02
 #define MTD_ERASE_SUSPEND      0x04
 #define MTD_ERASE_DONE          0x08
@@ -46,7 +46,7 @@ struct mtd_erase_region_info {
 struct mtd_info {
        u_char type;
        u_int32_t flags;
-       u_int32_t size;  // Total size of the MTD
+       u_int32_t size;  /* Total size of the MTD */
 
        /* "Major" erase size for the device. Naïve users may take this
         * to be the only erase size available, or may use the more detailed
@@ -54,25 +54,25 @@ struct mtd_info {
         */
        u_int32_t erasesize;
 
-       u_int32_t oobblock;  // Size of OOB blocks (e.g. 512)
-       u_int32_t oobsize;   // Amount of OOB data per block (e.g. 16)
-       u_int32_t oobavail;  // Number of bytes in OOB area available for fs 
+       u_int32_t oobblock;  /* Size of OOB blocks (e.g. 512) */
+       u_int32_t oobsize;   /* Amount of OOB data per block (e.g. 16) */
+       u_int32_t oobavail;  /* Number of bytes in OOB area available for fs  */
        u_int32_t ecctype;
        u_int32_t eccsize;
-       
 
-       // Kernel-only stuff starts here.
+
+       /* Kernel-only stuff starts here. */
        char *name;
        int index;
 
-       // oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO)
+       /* oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO) */
        struct nand_oobinfo oobinfo;
 
        /* Data for variable erase regions. If numeraseregions is zero,
-        * it means that the whole device has erasesize as given above. 
+        * it means that the whole device has erasesize as given above.
         */
        int numeraseregions;
-       struct mtd_erase_region_info *eraseregions; 
+       struct mtd_erase_region_info *eraseregions;
 
        /* This really shouldn't be here. It can go away in 2.5 */
        u_int32_t bank_size;
@@ -95,10 +95,10 @@ struct mtd_info {
        int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
        int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
 
-       /* 
-        * Methods to access the protection register area, present in some 
+       /*
+        * Methods to access the protection register area, present in some
         * flash devices. The user data is one time programmable but the
-        * factory data is read only. 
+        * factory data is read only.
         */
        int (*read_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
 
@@ -109,14 +109,14 @@ struct mtd_info {
 #if 0
        /* kvec-based read/write methods. We need these especially for NAND flash,
           with its limited number of write cycles per erase.
-          NB: The 'count' parameter is the number of _vectors_, each of 
+          NB: The 'count' parameter is the number of _vectors_, each of
           which contains an (ofs, len) tuple.
        */
        int (*readv) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen);
-       int (*readv_ecc) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, 
+       int (*readv_ecc) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from,
                size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
        int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen);
-       int (*writev_ecc) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, 
+       int (*writev_ecc) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to,
                size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
 #endif
        /* Sync */
@@ -179,7 +179,7 @@ int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs,
 #define MTD_WRITEECC(mtd, args...) (*(mtd->write_ecc))(mtd, args)
 #define MTD_READOOB(mtd, args...) (*(mtd->read_oob))(mtd, args)
 #define MTD_WRITEOOB(mtd, args...) (*(mtd->write_oob))(mtd, args)
-#define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd);  } while (0) 
+#define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd);  } while (0)
 
 
 #ifdef CONFIG_MTD_PARTITIONS
@@ -201,13 +201,13 @@ static inline void mtd_erase_callback(struct erase_info *instr)
 #define MTD_DEBUG_LEVEL3       (3)     /* Noisy   */
 
 #ifdef CONFIG_MTD_DEBUG
-#define DEBUG(n, args...)                              \
-       do {                                            \
+#define MTDDEBUG(n, args...)                           \
+       do {                                            \
                if (n <= CONFIG_MTD_DEBUG_VERBOSE)      \
                        printk(KERN_INFO args);         \
        } while(0)
 #else /* CONFIG_MTD_DEBUG */
-#define DEBUG(n, args...) do { } while(0)
+#define MTDDEBUG(n, args...) do { } while(0)
 
 #endif /* CONFIG_MTD_DEBUG */