Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
authorDavid Woodhouse <dwmw2@infradead.org>
Wed, 3 May 2006 12:30:35 +0000 (13:30 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Wed, 3 May 2006 12:30:35 +0000 (13:30 +0100)
24 files changed:
MAINTAINERS
drivers/mtd/chips/map_ram.c
drivers/mtd/devices/block2mtd.c
drivers/mtd/devices/m25p80.c
drivers/mtd/devices/phram.c
drivers/mtd/devices/slram.c
drivers/mtd/maps/Kconfig
drivers/mtd/maps/nettel.c
drivers/mtd/mtdblock.c
drivers/mtd/mtdblock_ro.c
drivers/mtd/mtdchar.c
drivers/mtd/nand/Kconfig
drivers/mtd/nand/Makefile
drivers/mtd/nand/sharpsl.c
drivers/mtd/nand/ts7250.c [new file with mode: 0644]
fs/jffs2/compr.h
fs/jffs2/dir.c
fs/jffs2/gc.c
fs/jffs2/jffs2_fs_i.h [moved from include/linux/jffs2_fs_i.h with 100% similarity]
fs/jffs2/jffs2_fs_sb.h [moved from include/linux/jffs2_fs_sb.h with 100% similarity]
fs/jffs2/nodelist.h
fs/jffs2/readinode.c
fs/jffs2/summary.c
include/mtd/mtd-abi.h

index d6a8e5b434ecde096f6e0d123fb71748bb2a46c2..564cbfa716b12dc498392cf1b83400a6c982bffb 100644 (file)
@@ -1794,12 +1794,12 @@ S:     linux-scsi@vger.kernel.org
 W:     http://megaraid.lsilogic.com
 S:     Maintained
 
-MEMORY TECHNOLOGY DEVICES
+MEMORY TECHNOLOGY DEVICES (MTD)
 P:     David Woodhouse
 M:     dwmw2@infradead.org
 W:     http://www.linux-mtd.infradead.org/
 L:     linux-mtd@lists.infradead.org
-T:     git kernel.org:/pub/scm/linux/kernel/git/tglx/mtd-2.6.git
+T:     git git://git.infradead.org/mtd-2.6.git
 S:     Maintained
 
 MICROTEK X6 SCANNER
index bd2e876a814bfc6374660379b83503c64be2841e..763925747db6f60a6701aad1b68e2fdecb801457 100644 (file)
@@ -70,7 +70,7 @@ static struct mtd_info *map_ram_probe(struct map_info *map)
        mtd->read = mapram_read;
        mtd->write = mapram_write;
        mtd->sync = mapram_nop;
-       mtd->flags = MTD_CAP_RAM | MTD_VOLATILE;
+       mtd->flags = MTD_CAP_RAM;
 
        mtd->erasesize = PAGE_SIZE;
        while(mtd->size & (mtd->erasesize - 1))
index 4160b8334c53e0881cdc12c1f7d3d54fff883772..f54e4bf9b968f153400312a74689f7028650b5d4 100644 (file)
@@ -4,7 +4,7 @@
  * block2mtd.c - create an mtd from a block device
  *
  * Copyright (C) 2001,2002     Simon Evans <spse@secret.org.uk>
- * Copyright (C) 2004,2005     Jörn Engel <joern@wh.fh-wedel.de>
+ * Copyright (C) 2004-2006     Jörn Engel <joern@wh.fh-wedel.de>
  *
  * Licence: GPL
  */
@@ -351,6 +351,12 @@ devinit_err:
 }
 
 
+/* This function works similar to reguler strtoul.  In addition, it
+ * allows some suffixes for a more human-readable number format:
+ * ki, Ki, kiB, KiB    - multiply result with 1024
+ * Mi, MiB             - multiply result with 1024^2
+ * Gi, GiB             - multiply result with 1024^3
+ */
 static int ustrtoul(const char *cp, char **endp, unsigned int base)
 {
        unsigned long result = simple_strtoul(cp, endp, base);
@@ -359,11 +365,16 @@ static int ustrtoul(const char *cp, char **endp, unsigned int base)
                result *= 1024;
        case 'M':
                result *= 1024;
+       case 'K':
        case 'k':
                result *= 1024;
        /* By dwmw2 editorial decree, "ki", "Mi" or "Gi" are to be used. */
-               if ((*endp)[1] == 'i')
-                       (*endp) += 2;
+               if ((*endp)[1] == 'i') {
+                       if ((*endp)[2] == 'B')
+                               (*endp) += 3;
+                       else
+                               (*endp) += 2;
+               }
        }
        return result;
 }
index 04e65d5dae000f9b3d4f0c94c114da26169d2548..d5f24089be717ab9ec0779208f7f1941a6d320d1 100644 (file)
@@ -186,7 +186,7 @@ static int m25p80_erase(struct mtd_info *mtd, struct erase_info *instr)
        struct m25p *flash = mtd_to_m25p(mtd);
        u32 addr,len;
 
-       DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %d\n",
+       DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %zd\n",
                        flash->spi->dev.bus_id, __FUNCTION__, "at",
                        (u32)instr->addr, instr->len);
 
index e8685ee6c1e425f202b8ca2b91ea6de05dc8c8ae..41af9693d880b9ca2947806b2626258cfd6feb1f 100644 (file)
@@ -142,7 +142,7 @@ static int register_device(char *name, unsigned long start, unsigned long len)
 
        new->mtd.name = name;
        new->mtd.size = len;
-       new->mtd.flags = MTD_CAP_RAM | MTD_ERASEABLE | MTD_VOLATILE;
+       new->mtd.flags = MTD_CAP_RAM;
         new->mtd.erase = phram_erase;
        new->mtd.point = phram_point;
        new->mtd.unpoint = phram_unpoint;
index 6faee6c6958c2a7bc709b53df6cf61ff6c507369..b3f665e3c38bfeec5fade51e3c4fb77ee61bc7b4 100644 (file)
@@ -200,8 +200,7 @@ static int register_device(char *name, unsigned long start, unsigned long length
 
        (*curmtd)->mtdinfo->name = name;
        (*curmtd)->mtdinfo->size = length;
-       (*curmtd)->mtdinfo->flags = MTD_CLEAR_BITS | MTD_SET_BITS |
-                                       MTD_WRITEB_WRITEABLE | MTD_VOLATILE | MTD_CAP_RAM;
+       (*curmtd)->mtdinfo->flags = MTD_CAP_RAM;
         (*curmtd)->mtdinfo->erase = slram_erase;
        (*curmtd)->mtdinfo->point = slram_point;
        (*curmtd)->mtdinfo->unpoint = slram_unpoint;
index 7abd7fee0ddaa669b64f167e587c6e3a8ab7aacf..80d6810e88ed525094fad908c52de00664c36229 100644 (file)
@@ -78,7 +78,7 @@ config MTD_PNC2000
 
 config MTD_SC520CDP
        tristate "CFI Flash device mapped on AMD SC520 CDP"
-       depends on X86 && MTD_CFI
+       depends on X86 && MTD_CFI && MTD_CONCAT
        help
          The SC520 CDP board has two banks of CFI-compliant chips and one
          Dual-in-line JEDEC chip. This 'mapping' driver supports that
index 54a3102ab19a8868cbd18c2d1ce5cf9c92111ea6..20771b2a05e1b800e8e588fdb453c472e0f4d638 100644 (file)
@@ -20,6 +20,8 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/cfi.h>
 #include <linux/reboot.h>
+#include <linux/kdev_t.h>
+#include <linux/root_dev.h>
 #include <asm/io.h>
 
 /****************************************************************************/
index 2cef280e388c76aaf455fe49f3232596f8d40308..8e50170137e003f3ff35504dc0634646d36bcb52 100644 (file)
@@ -288,8 +288,7 @@ static int mtdblock_open(struct mtd_blktrans_dev *mbd)
 
        mutex_init(&mtdblk->cache_mutex);
        mtdblk->cache_state = STATE_EMPTY;
-       if ((mtdblk->mtd->flags & MTD_CAP_RAM) != MTD_CAP_RAM &&
-           mtdblk->mtd->erasesize) {
+       if (mtdblk->mtd->type != MTD_RAM && mtdblk->mtd->erasesize) {
                mtdblk->cache_size = mtdblk->mtd->erasesize;
                mtdblk->cache_data = NULL;
        }
index 0c830ba41ef05b3e93c39f316b1217149645b672..29563ed258a4788bf86eb03341b4fad0440ed2d0 100644 (file)
@@ -45,9 +45,7 @@ static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
        dev->blksize = 512;
        dev->size = mtd->size >> 9;
        dev->tr = tr;
-       if ((mtd->flags & (MTD_CLEAR_BITS|MTD_SET_BITS|MTD_WRITEABLE)) !=
-           (MTD_CLEAR_BITS|MTD_SET_BITS|MTD_WRITEABLE))
-               dev->readonly = 1;
+       dev->readonly = 1;
 
        add_mtd_blktrans_dev(dev);
 }
index 6f044584bdc6ac3b38c4a20949bfcbabb5f292ae..6b83aee8abb8ee137c51b4d07075a62a5610d87a 100644 (file)
@@ -170,16 +170,22 @@ static ssize_t mtd_read(struct file *file, char __user *buf, size_t count,loff_t
 
        /* FIXME: Use kiovec in 2.5 to lock down the user's buffers
           and pass them directly to the MTD functions */
+
+       if (count > MAX_KMALLOC_SIZE)
+               kbuf=kmalloc(MAX_KMALLOC_SIZE, GFP_KERNEL);
+       else
+               kbuf=kmalloc(count, GFP_KERNEL);
+
+       if (!kbuf)
+               return -ENOMEM;
+
        while (count) {
+
                if (count > MAX_KMALLOC_SIZE)
                        len = MAX_KMALLOC_SIZE;
                else
                        len = count;
 
-               kbuf=kmalloc(len,GFP_KERNEL);
-               if (!kbuf)
-                       return -ENOMEM;
-
                switch (MTD_MODE(file)) {
                case MTD_MODE_OTP_FACT:
                        ret = mtd->read_fact_prot_reg(mtd, *ppos, len, &retlen, kbuf);
@@ -215,9 +221,9 @@ static ssize_t mtd_read(struct file *file, char __user *buf, size_t count,loff_t
                        return ret;
                }
 
-               kfree(kbuf);
        }
 
+       kfree(kbuf);
        return total_retlen;
 } /* mtd_read */
 
@@ -241,18 +247,21 @@ static ssize_t mtd_write(struct file *file, const char __user *buf, size_t count
        if (!count)
                return 0;
 
+       if (count > MAX_KMALLOC_SIZE)
+               kbuf=kmalloc(MAX_KMALLOC_SIZE, GFP_KERNEL);
+       else
+               kbuf=kmalloc(count, GFP_KERNEL);
+
+       if (!kbuf)
+               return -ENOMEM;
+
        while (count) {
+
                if (count > MAX_KMALLOC_SIZE)
                        len = MAX_KMALLOC_SIZE;
                else
                        len = count;
 
-               kbuf=kmalloc(len,GFP_KERNEL);
-               if (!kbuf) {
-                       printk("kmalloc is null\n");
-                       return -ENOMEM;
-               }
-
                if (copy_from_user(kbuf, buf, len)) {
                        kfree(kbuf);
                        return -EFAULT;
@@ -282,10 +291,9 @@ static ssize_t mtd_write(struct file *file, const char __user *buf, size_t count
                        kfree(kbuf);
                        return ret;
                }
-
-               kfree(kbuf);
        }
 
+       kfree(kbuf);
        return total_retlen;
 } /* mtd_write */
 
index cfe288a6e85358b2a639e779aef1dc0f84928c79..b735ab61c1e74e650f8ac309c180bc678bf4363f 100644 (file)
@@ -55,6 +55,12 @@ config MTD_NAND_TOTO
        help
          Support for NAND flash on Texas Instruments Toto platform.
 
+config MTD_NAND_TS7250
+       tristate "NAND Flash device on TS-7250 board"
+       depends on MACH_TS72XX && MTD_NAND
+       help
+         Support for NAND flash on Technologic Systems TS-7250 platform.
+
 config MTD_NAND_IDS
        tristate
 
index 41742026a52e7e45033f8a37ef57d7b0222c55df..073705bc8c2d2afb7648afacc26d4fdb7585b7a0 100644 (file)
@@ -17,6 +17,7 @@ obj-$(CONFIG_MTD_NAND_DISKONCHIP)     += diskonchip.o
 obj-$(CONFIG_MTD_NAND_H1900)           += h1910.o
 obj-$(CONFIG_MTD_NAND_RTC_FROM4)       += rtc_from4.o
 obj-$(CONFIG_MTD_NAND_SHARPSL)         += sharpsl.o
+obj-$(CONFIG_MTD_NAND_TS7250)          += ts7250.o
 obj-$(CONFIG_MTD_NAND_NANDSIM)         += nandsim.o
 
 nand-objs = nand_base.o nand_bbt.o
index 1924a4f137c79eed315673de214224d225e78e70..c294374871a4d64614bb29ac4ba43afe82aea181 100644 (file)
@@ -237,7 +237,7 @@ sharpsl_nand_init(void)
                nr_partitions = DEFAULT_NUM_PARTITIONS;
                sharpsl_partition_info = sharpsl_nand_default_partition_info;
                if (machine_is_poodle()) {
-                       sharpsl_partition_info[1].size=30 * 1024 * 1024;
+                       sharpsl_partition_info[1].size=22 * 1024 * 1024;
                } else if (machine_is_corgi() || machine_is_shepherd()) {
                        sharpsl_partition_info[1].size=25 * 1024 * 1024;
                } else if (machine_is_husky()) {
diff --git a/drivers/mtd/nand/ts7250.c b/drivers/mtd/nand/ts7250.c
new file mode 100644 (file)
index 0000000..643633d
--- /dev/null
@@ -0,0 +1,208 @@
+/*
+ * drivers/mtd/nand/ts7250.c
+ *
+ * Copyright (C) 2004 Technologic Systems (support@embeddedARM.com)
+ *
+ * Derived from drivers/mtd/nand/edb7312.c
+ *   Copyright (C) 2004 Marius Gröger (mag@sysgo.de)
+ *
+ * Derived from drivers/mtd/nand/autcpu12.c
+ *   Copyright (c) 2001 Thomas Gleixner (gleixner@autronix.de)
+ *
+ * $Id: ts7250.c,v 1.4 2004/12/30 22:02:07 joff Exp $
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Overview:
+ *   This is a device driver for the NAND flash device found on the
+ *   TS-7250 board which utilizes a Samsung 32 Mbyte part.
+ */
+
+#include <linux/slab.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
+#include <linux/mtd/partitions.h>
+#include <asm/io.h>
+#include <asm/arch/hardware.h>
+#include <asm/sizes.h>
+#include <asm/mach-types.h>
+
+/*
+ * MTD structure for TS7250 board
+ */
+static struct mtd_info *ts7250_mtd = NULL;
+
+#ifdef CONFIG_MTD_PARTITIONS
+static const char *part_probes[] = { "cmdlinepart", NULL };
+
+#define NUM_PARTITIONS 3
+
+/*
+ * Define static partitions for flash device
+ */
+static struct mtd_partition partition_info32[] = {
+       {
+               .name           = "TS-BOOTROM",
+               .offset         = 0x00000000,
+               .size           = 0x00004000,
+       }, {
+               .name           = "Linux",
+               .offset         = 0x00004000,
+               .size           = 0x01d00000,
+       }, {
+               .name           = "RedBoot",
+               .offset         = 0x01d04000,
+               .size           = 0x002fc000,
+       },
+};
+
+/*
+ * Define static partitions for flash device
+ */
+static struct mtd_partition partition_info128[] = {
+       {
+               .name           = "TS-BOOTROM",
+               .offset         = 0x00000000,
+               .size           = 0x00004000,
+       }, {
+               .name           = "Linux",
+               .offset         = 0x00004000,
+               .size           = 0x07d00000,
+       }, {
+               .name           = "RedBoot",
+               .offset         = 0x07d04000,
+               .size           = 0x002fc000,
+       },
+};
+#endif
+
+
+/*
+ *     hardware specific access to control-lines
+ */
+static void ts7250_hwcontrol(struct mtd_info *mtd, int cmd)
+{
+       unsigned long ctrl = TS72XX_NAND_CONTROL_VIRT_BASE;
+
+       switch(cmd) {
+       case NAND_CTL_SETCLE:
+               __raw_writeb(__raw_readb(ctrl) | 0x2, ctrl);
+               break;
+       case NAND_CTL_CLRCLE:
+               __raw_writeb(__raw_readb(ctrl) & ~0x2, ctrl);
+               break;
+       case NAND_CTL_SETALE:
+               __raw_writeb(__raw_readb(ctrl) | 0x1, ctrl);
+               break;
+       case NAND_CTL_CLRALE:
+               __raw_writeb(__raw_readb(ctrl) & ~0x1, ctrl);
+               break;
+       case NAND_CTL_SETNCE:
+               __raw_writeb(__raw_readb(ctrl) | 0x4, ctrl);
+               break;
+       case NAND_CTL_CLRNCE:
+               __raw_writeb(__raw_readb(ctrl) & ~0x4, ctrl);
+               break;
+       }
+}
+
+/*
+ *     read device ready pin
+ */
+static int ts7250_device_ready(struct mtd_info *mtd)
+{
+       return __raw_readb(TS72XX_NAND_BUSY_VIRT_BASE) & 0x20;
+}
+
+/*
+ * Main initialization routine
+ */
+static int __init ts7250_init(void)
+{
+       struct nand_chip *this;
+       const char *part_type = 0;
+       int mtd_parts_nb = 0;
+       struct mtd_partition *mtd_parts = 0;
+
+       if (!machine_is_ts72xx() || board_is_ts7200())
+               return -ENXIO;
+
+       /* Allocate memory for MTD device structure and private data */
+       ts7250_mtd = kmalloc(sizeof(struct mtd_info) +
+                               sizeof(struct nand_chip), GFP_KERNEL);
+       if (!ts7250_mtd) {
+               printk("Unable to allocate TS7250 NAND MTD device structure.\n");
+               return -ENOMEM;
+       }
+
+       /* Get pointer to private data */
+       this = (struct nand_chip *)(&ts7250_mtd[1]);
+
+       /* Initialize structures */
+       memset(ts7250_mtd, 0, sizeof(struct mtd_info));
+       memset(this, 0, sizeof(struct nand_chip));
+
+       /* Link the private data with the MTD structure */
+       ts7250_mtd->priv = this;
+
+       /* insert callbacks */
+       this->IO_ADDR_R = (void *)TS72XX_NAND_DATA_VIRT_BASE;
+       this->IO_ADDR_W = (void *)TS72XX_NAND_DATA_VIRT_BASE;
+       this->hwcontrol = ts7250_hwcontrol;
+       this->dev_ready = ts7250_device_ready;
+       this->chip_delay = 15;
+       this->eccmode = NAND_ECC_SOFT;
+
+       printk("Searching for NAND flash...\n");
+       /* Scan to find existence of the device */
+       if (nand_scan(ts7250_mtd, 1)) {
+               kfree(ts7250_mtd);
+               return -ENXIO;
+       }
+
+#ifdef CONFIG_MTD_PARTITIONS
+       ts7250_mtd->name = "ts7250-nand";
+       mtd_parts_nb = parse_mtd_partitions(ts7250_mtd, part_probes,
+                                               &mtd_parts, 0);
+       if (mtd_parts_nb > 0)
+               part_type = "command line";
+       else
+               mtd_parts_nb = 0;
+#endif
+       if (mtd_parts_nb == 0) {
+               mtd_parts = partition_info32;
+               if (ts7250_mtd->size >= (128 * 0x100000))
+                       mtd_parts = partition_info128;
+               mtd_parts_nb = NUM_PARTITIONS;
+               part_type = "static";
+       }
+
+       /* Register the partitions */
+       printk(KERN_NOTICE "Using %s partition definition\n", part_type);
+       add_mtd_partitions(ts7250_mtd, mtd_parts, mtd_parts_nb);
+
+       /* Return happy */
+       return 0;
+}
+module_init(ts7250_init);
+
+/*
+ * Clean up routine
+ */
+static void __exit ts7250_cleanup(void)
+{
+       /* Unregister the device */
+       del_mtd_device(ts7250_mtd);
+
+       /* Free the MTD device structure */
+       kfree(ts7250_mtd);
+}
+module_exit(ts7250_cleanup);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Jesse Off <joff@embeddedARM.com>");
+MODULE_DESCRIPTION("MTD map driver for Technologic Systems TS-7250 board");
index a77e830d85c5fb0cd230dba36670422554bcb398..509b8b1c0811dfb3bea24d92176ab0c9ff4f5250 100644 (file)
@@ -23,8 +23,8 @@
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/jffs2.h>
-#include <linux/jffs2_fs_i.h>
-#include <linux/jffs2_fs_sb.h>
+#include "jffs2_fs_i.h"
+#include "jffs2_fs_sb.h"
 #include "nodelist.h"
 
 #define JFFS2_RUBINMIPS_PRIORITY 10
index 8bc7a5018e4044be500c3e14bf73b974673c6646..1c8e8c0f6ceac9ec2cf2fdf058dffea177559547 100644 (file)
@@ -17,8 +17,8 @@
 #include <linux/fs.h>
 #include <linux/crc32.h>
 #include <linux/jffs2.h>
-#include <linux/jffs2_fs_i.h>
-#include <linux/jffs2_fs_sb.h>
+#include "jffs2_fs_i.h"
+#include "jffs2_fs_sb.h"
 #include <linux/time.h>
 #include "nodelist.h"
 
@@ -78,6 +78,9 @@ static struct dentry *jffs2_lookup(struct inode *dir_i, struct dentry *target,
 
        D1(printk(KERN_DEBUG "jffs2_lookup()\n"));
 
+       if (target->d_name.len > JFFS2_MAX_NAME_LEN)
+               return ERR_PTR(-ENAMETOOLONG);
+
        dir_f = JFFS2_INODE_INFO(dir_i);
        c = JFFS2_SB_INFO(dir_i->i_sb);
 
index f9ffece453a38e65542db843701749f943a71283..967fb2cf8e21ed849cc330fce8aa7928c51ae0ef 100644 (file)
@@ -181,6 +181,10 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
                           and trigger the BUG() above while we haven't yet
                           finished checking all its nodes */
                        D1(printk(KERN_DEBUG "Waiting for ino #%u to finish reading\n", ic->ino));
+                       /* We need to come back again for the _same_ inode. We've
+                        made no progress in this case, but that should be OK */
+                       c->checked_ino--;
+
                        up(&c->alloc_sem);
                        sleep_on_spinunlock(&c->inocache_wq, &c->inocache_lock);
                        return 0;
index 23a67bb3052f916fb60aee403aa48cf802c0c517..f6645afe88e448685e955cc4521b7fdc969e68da 100644 (file)
@@ -18,8 +18,8 @@
 #include <linux/fs.h>
 #include <linux/types.h>
 #include <linux/jffs2.h>
-#include <linux/jffs2_fs_sb.h>
-#include <linux/jffs2_fs_i.h>
+#include "jffs2_fs_sb.h"
+#include "jffs2_fs_i.h"
 #include "summary.h"
 
 #ifdef __ECOS
index f1695642d0f7f218757fbdcff49ac0e0ed440a35..e1acce8fb2bff6afa2c18ade37b366015828031d 100644 (file)
@@ -204,7 +204,7 @@ static inline int read_dnode(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
 
        tn = jffs2_alloc_tmp_dnode_info();
        if (!tn) {
-               JFFS2_ERROR("failed to allocate tn (%d bytes).\n", sizeof(*tn));
+               JFFS2_ERROR("failed to allocate tn (%zu bytes).\n", sizeof(*tn));
                return -ENOMEM;
        }
 
@@ -434,7 +434,7 @@ static int read_more(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref,
        }
 
        if (retlen < len) {
-               JFFS2_ERROR("short read at %#08x: %d instead of %d.\n",
+               JFFS2_ERROR("short read at %#08x: %zu instead of %d.\n",
                                offs, retlen, len);
                return -EIO;
        }
@@ -542,7 +542,7 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf
                }
 
                if (retlen < len) {
-                       JFFS2_ERROR("short read at %#08x: %d instead of %d.\n", ref_offset(ref), retlen, len);
+                       JFFS2_ERROR("short read at %#08x: %zu instead of %d.\n", ref_offset(ref), retlen, len);
                        err = -EIO;
                        goto free_out;
                }
index fb9cec61fcf2ebbe050d58669551ca311b6c7e70..3240d62d97073aa402d4028c5b33d5bbe775ed63 100644 (file)
@@ -655,7 +655,7 @@ static int jffs2_sum_write_data(struct jffs2_sb_info *c, struct jffs2_eraseblock
 
 
        if (ret || (retlen != infosize)) {
-               JFFS2_WARNING("Write of %zd bytes at 0x%08x failed. returned %d, retlen %zd\n",
+               JFFS2_WARNING("Write of %d bytes at 0x%08x failed. returned %d, retlen %zu\n",
                        infosize, jeb->offset + c->sector_size - jeb->free_size, ret, retlen);
 
                c->summary->sum_size = JFFS2_SUMMARY_NOSUM_SIZE;
index b5994ea56a5a19ba6aae6f297e370ea9bd1b4d60..fa2524157846afeebecbe9fffeb86844a1d392fb 100644 (file)
@@ -28,27 +28,18 @@ struct mtd_oob_buf {
 #define MTD_ROM                        2
 #define MTD_NORFLASH           3
 #define MTD_NANDFLASH          4
-#define MTD_PEROM              5
 #define MTD_DATAFLASH          6
-#define MTD_OTHER              14
-#define MTD_UNKNOWN            15
 
 #define MTD_CLEAR_BITS         1       // Bits can be cleared (flash)
 #define MTD_SET_BITS           2       // Bits can be set
-#define MTD_ERASEABLE          4       // Has an erase function
-#define MTD_WRITEB_WRITEABLE   8       // Direct IO is possible
-#define MTD_VOLATILE           16      // Set for RAMs
-#define MTD_XIP                        32      // eXecute-In-Place possible
-#define MTD_OOB                        64      // Out-of-band data (NAND flash)
 #define MTD_ECC                        128     // Device capable of automatic ECC
-#define MTD_NO_VIRTBLOCKS      256     // Virtual blocks not allowed
 #define MTD_PROGRAM_REGIONS    512     // Configurable Programming Regions
 
 // Some common devices / combinations of capabilities
 #define MTD_CAP_ROM            0
-#define MTD_CAP_RAM            (MTD_CLEAR_BITS|MTD_SET_BITS|MTD_WRITEB_WRITEABLE)
-#define MTD_CAP_NORFLASH        (MTD_CLEAR_BITS|MTD_ERASEABLE)
-#define MTD_CAP_NANDFLASH       (MTD_CLEAR_BITS|MTD_ERASEABLE|MTD_OOB)
+#define MTD_CAP_RAM            (MTD_CLEAR_BITS|MTD_SET_BITS)
+#define MTD_CAP_NORFLASH       (MTD_CLEAR_BITS)
+#define MTD_CAP_NANDFLASH      (MTD_CLEAR_BITS)
 #define MTD_WRITEABLE          (MTD_CLEAR_BITS|MTD_SET_BITS)