]> Pileus Git - ~andy/linux/commitdiff
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
authorDavid Woodhouse <dwmw2@infradead.org>
Wed, 17 Jan 2007 23:34:51 +0000 (10:34 +1100)
committerDavid Woodhouse <dwmw2@infradead.org>
Wed, 17 Jan 2007 23:34:51 +0000 (10:34 +1100)
1  2 
drivers/mtd/devices/mtd_dataflash.c
drivers/mtd/maps/Kconfig
drivers/mtd/rfd_ftl.c
fs/jffs/jffs_fm.c
fs/jffs2/super.c
fs/jffs2/wbuf.c

index 10a4f4e263fee80a64c04fc5727985f5052c51f7,910e4061dfd231dd31a5c1c97bf7d3f8d6c41f71..a987e917f4e07e4c1bc534b574f66841d9c55cd3
@@@ -459,7 -459,7 +459,7 @@@ add_dataflash(struct spi_device *spi, c
        struct mtd_info                 *device;
        struct flash_platform_data      *pdata = spi->dev.platform_data;
  
-       priv = (struct dataflash *) kzalloc(sizeof *priv, GFP_KERNEL);
+       priv = kzalloc(sizeof *priv, GFP_KERNEL);
        if (!priv)
                return -ENOMEM;
  
        device->writesize = pagesize;
        device->owner = THIS_MODULE;
        device->type = MTD_DATAFLASH;
 -      device->flags = MTD_CAP_NORFLASH;
 +      device->flags = MTD_WRITEABLE;
        device->erase = dataflash_erase;
        device->read = dataflash_read;
        device->write = dataflash_write;
@@@ -536,7 -536,7 +536,7 @@@ static int __devinit dataflash_probe(st
        if (status <= 0 || status == 0xff) {
                DEBUG(MTD_DEBUG_LEVEL1, "%s: status error %d\n",
                                spi->dev.bus_id, status);
-               if (status == 0xff)
+               if (status == 0 || status == 0xff)
                        status = -ENODEV;
                return status;
        }
diff --combined drivers/mtd/maps/Kconfig
index 3a33b98eb93dcf977f55c7748e0a421991f3bf96,d132ed571f1398d8ec8fb35f6c126c6aafd5f717..f457315579db924c71ba6298ec91f0e6a952af9d
@@@ -60,15 -60,6 +60,15 @@@ config MTD_PHYSMAP_BANKWIDT
          Ignore this option if you use run-time physmap configuration
          (i.e., run-time calling physmap_configure()).
  
 +config MTD_PHYSMAP_OF
 +      tristate "Flash device in physical memory map based on OF descirption"
 +      depends on PPC_OF && (MTD_CFI || MTD_JEDECPROBE || MTD_ROM)
 +      help
 +        This provides a 'mapping' driver which allows the NOR Flash and
 +        ROM driver code to communicate with chips which are mapped
 +        physically into the CPU's memory. The mapping description here is
 +        taken from OF device tree.
 +
  config MTD_SUN_UFLASH
        tristate "Sun Microsystems userflash support"
        depends on SPARC && MTD_CFI
@@@ -193,24 -184,6 +193,24 @@@ config MTD_ICHXRO
  
          BE VERY CAREFUL.
  
 +config MTD_ESB2ROM
 +        tristate "BIOS flash chip on Intel ESB Controller Hub 2"
 +        depends on X86 && MTD_JEDECPROBE && PCI
 +        help
 +          Support for treating the BIOS flash chip on ESB2 motherboards
 +          as an MTD device - with this you can reprogram your BIOS.
 +
 +          BE VERY CAREFUL.
 +
 +config MTD_CK804XROM
 +      tristate "BIOS flash chip on Nvidia CK804"
 +      depends on X86 && MTD_JEDECPROBE
 +      help
 +        Support for treating the BIOS flash chip on nvidia motherboards
 +        as an MTD device - with this you can reprogram your BIOS.
 +
 +        BE VERY CAREFUL.
 +
  config MTD_SCB2_FLASH
        tristate "BIOS flash chip on Intel SCB2 boards"
        depends on X86 && MTD_JEDECPROBE
@@@ -382,6 -355,50 +382,6 @@@ config MTD_TQM834
          TQ Components TQM834x boards. If you have one of these boards
          and would like to use the flash chips on it, say 'Y'.
  
 -config MTD_CSTM_MIPS_IXX
 -      tristate "Flash chip mapping on ITE QED-4N-S01B, Globespan IVR or custom board"
 -      depends on MIPS && MTD_CFI && MTD_JEDECPROBE && MTD_PARTITIONS
 -      help
 -        This provides a mapping driver for the Integrated Technology
 -        Express, Inc (ITE) QED-4N-S01B eval board and the Globespan IVR
 -        Reference Board. It provides the necessary addressing, length,
 -        buswidth, vpp code and addition setup of the flash device for
 -        these boards. In addition, this mapping driver can be used for
 -        other boards via setting of the CONFIG_MTD_CSTM_MIPS_IXX_START/
 -        LEN/BUSWIDTH parameters. This mapping will provide one mtd device
 -        using one partition. The start address can be offset from the
 -        beginning of flash and the len can be less than the total flash
 -        device size to allow a window into the flash. Both CFI and JEDEC
 -        probes are called.
 -
 -config MTD_CSTM_MIPS_IXX_START
 -      hex "Physical start address of flash mapping"
 -      depends on MTD_CSTM_MIPS_IXX
 -      default "0x8000000"
 -      help
 -        This is the physical memory location that the MTD driver will
 -        use for the flash chips on your particular target board.
 -        Refer to the memory map which should hopefully be in the
 -        documentation for your board.
 -
 -config MTD_CSTM_MIPS_IXX_LEN
 -      hex "Physical length of flash mapping"
 -      depends on MTD_CSTM_MIPS_IXX
 -      default "0x4000000"
 -      help
 -        This is the total length that the MTD driver will use for the
 -        flash chips on your particular board.  Refer to the memory
 -        map which should hopefully be in the documentation for your
 -        board.
 -
 -config MTD_CSTM_MIPS_IXX_BUSWIDTH
 -      int "Bus width in octets"
 -      depends on MTD_CSTM_MIPS_IXX
 -      default "2"
 -      help
 -        This is the total bus width of the mapping of the flash chips
 -        on your particular board.
 -
  config MTD_OCELOT
        tristate "Momenco Ocelot boot flash device"
        depends on MIPS && MOMENCO_OCELOT
@@@ -590,7 -607,7 +590,7 @@@ config MTD_BAST_MAXSIZ
        default "4"
  
  config MTD_SHARP_SL
-       bool "ROM maped on Sharp SL Series"
+       bool "ROM mapped on Sharp SL Series"
        depends on MTD && ARCH_PXA
        help
          This enables access to the flash chip on the Sharp SL Series of PDAs.
diff --combined drivers/mtd/rfd_ftl.c
index d60cc6696cbd6cac2778148f7d47c8abce839630,0f3baa5d9c2a08a147639518f4703251e595b7ad..d4b1ba8f23ef40b0dd072fc2c251c46f8f54dc7d
@@@ -768,7 -768,7 +768,7 @@@ static void rfd_ftl_add_mtd(struct mtd_
        if (mtd->type != MTD_NORFLASH)
                return;
  
-       part = kcalloc(1, sizeof(struct partition), GFP_KERNEL);
+       part = kzalloc(sizeof(struct partition), GFP_KERNEL);
        if (!part)
                return;
  
  
        if (scan_header(part) == 0) {
                part->mbd.size = part->sector_count;
 -              part->mbd.blksize = SECTOR_SIZE;
                part->mbd.tr = tr;
                part->mbd.devnum = -1;
                if (!(mtd->flags & MTD_WRITEABLE))
@@@ -828,8 -829,6 +828,8 @@@ struct mtd_blktrans_ops rfd_ftl_tr = 
        .name           = "rfd",
        .major          = RFD_FTL_MAJOR,
        .part_bits      = PART_BITS,
 +      .blksize        = SECTOR_SIZE,
 +
        .readsect       = rfd_ftl_readsect,
        .writesect      = rfd_ftl_writesect,
        .getgeo         = rfd_ftl_getgeo,
diff --combined fs/jffs/jffs_fm.c
index 6aab317f56e0cbc83d71afd0f87e0512da0a7a54,077258b2103e5bac0d386a46102f4741292e5b2d..5a95fbdd6fdba7b7d94830e55c6bb6e7ace11efb
@@@ -17,7 -17,6 +17,7 @@@
   *
   */
  #include <linux/slab.h>
 +#include <linux/err.h>
  #include <linux/blkdev.h>
  #include <linux/jffs.h>
  #include "jffs_fm.h"
@@@ -30,8 -29,8 +30,8 @@@ static int jffs_mark_obsolete(struct jf
  static struct jffs_fm *jffs_alloc_fm(void);
  static void jffs_free_fm(struct jffs_fm *n);
  
- extern kmem_cache_t     *fm_cache;
- extern kmem_cache_t     *node_cache;
+ extern struct kmem_cache     *fm_cache;
+ extern struct kmem_cache     *node_cache;
  
  #if CONFIG_JFFS_FS_VERBOSE > 0
  void
@@@ -105,7 -104,7 +105,7 @@@ jffs_build_begin(struct jffs_control *c
  
        mtd = get_mtd_device(NULL, unit);
  
 -      if (!mtd) {
 +      if (IS_ERR(mtd)) {
                kfree(fmc);
                DJM(no_jffs_fmcontrol--);
                return NULL;
diff --combined fs/jffs2/super.c
index 590f60a897c14d6bc51db9adb232c375ae43d188,7deb7825402156fcd5f04d47b518452df2945a7f..08a0e6c49e61d77b4d51b03714108df0b0840462
@@@ -17,7 -17,6 +17,7 @@@
  #include <linux/init.h>
  #include <linux/list.h>
  #include <linux/fs.h>
 +#include <linux/err.h>
  #include <linux/mount.h>
  #include <linux/jffs2.h>
  #include <linux/pagemap.h>
  
  static void jffs2_put_super(struct super_block *);
  
- static kmem_cache_t *jffs2_inode_cachep;
+ static struct kmem_cache *jffs2_inode_cachep;
  
  static struct inode *jffs2_alloc_inode(struct super_block *sb)
  {
        struct jffs2_inode_info *ei;
-       ei = (struct jffs2_inode_info *)kmem_cache_alloc(jffs2_inode_cachep, SLAB_KERNEL);
+       ei = (struct jffs2_inode_info *)kmem_cache_alloc(jffs2_inode_cachep, GFP_KERNEL);
        if (!ei)
                return NULL;
        return &ei->vfs_inode;
@@@ -45,7 -44,7 +45,7 @@@ static void jffs2_destroy_inode(struct 
        kmem_cache_free(jffs2_inode_cachep, JFFS2_INODE_INFO(inode));
  }
  
- static void jffs2_i_init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+ static void jffs2_i_init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
  {
        struct jffs2_inode_info *ei = (struct jffs2_inode_info *) foo;
  
@@@ -185,9 -184,9 +185,9 @@@ static int jffs2_get_sb_mtdnr(struct fi
        struct mtd_info *mtd;
  
        mtd = get_mtd_device(NULL, mtdnr);
 -      if (!mtd) {
 +      if (IS_ERR(mtd)) {
                D1(printk(KERN_DEBUG "jffs2: MTD device #%u doesn't appear to exist\n", mtdnr));
 -              return -EINVAL;
 +              return PTR_ERR(mtd);
        }
  
        return jffs2_get_sb_mtd(fs_type, flags, dev_name, data, mtd, mnt);
@@@ -222,7 -221,7 +222,7 @@@ static int jffs2_get_sb(struct file_sys
                        D1(printk(KERN_DEBUG "jffs2_get_sb(): mtd:%%s, name \"%s\"\n", dev_name+4));
                        for (mtdnr = 0; mtdnr < MAX_MTD_DEVICES; mtdnr++) {
                                mtd = get_mtd_device(NULL, mtdnr);
 -                              if (mtd) {
 +                              if (!IS_ERR(mtd)) {
                                        if (!strcmp(mtd->name, dev_name+4))
                                                return jffs2_get_sb_mtd(fs_type, flags, dev_name, data, mtd, mnt);
                                        put_mtd_device(mtd);
diff --combined fs/jffs2/wbuf.c
index dcb18e9a646edc4ae80b2f79dd9118be8b0a9013,70707309dfa1c983250f9eb2307159fa51dda20e..9c99859f5eddb12f24386d1cab20f71dd52ef756
@@@ -19,6 -19,7 +19,7 @@@
  #include <linux/crc32.h>
  #include <linux/mtd/nand.h>
  #include <linux/jiffies.h>
+ #include <linux/sched.h>
  
  #include "nodelist.h"
  
@@@ -968,7 -969,8 +969,7 @@@ int jffs2_check_oob_empty(struct jffs2_
        int oobsize = c->mtd->oobsize;
        struct mtd_oob_ops ops;
  
 -      ops.len = NR_OOB_SCAN_PAGES * oobsize;
 -      ops.ooblen = oobsize;
 +      ops.ooblen = NR_OOB_SCAN_PAGES * oobsize;
        ops.oobbuf = c->oobbuf;
        ops.ooboffs = 0;
        ops.datbuf = NULL;
                return ret;
        }
  
 -      if (ops.retlen < ops.len) {
 +      if (ops.oobretlen < ops.ooblen) {
                D1(printk(KERN_WARNING "jffs2_check_oob_empty(): Read OOB "
                          "returned short read (%zd bytes not %d) for block "
 -                        "at %08x\n", ops.retlen, ops.len, jeb->offset));
 +                        "at %08x\n", ops.oobretlen, ops.ooblen, jeb->offset));
                return -EIO;
        }
  
        }
  
        /* we know, we are aligned :) */
 -      for (page = oobsize; page < ops.len; page += sizeof(long)) {
 +      for (page = oobsize; page < ops.ooblen; page += sizeof(long)) {
                long dat = *(long *)(&ops.oobbuf[page]);
                if(dat != -1)
                        return 1;
@@@ -1031,6 -1033,7 +1032,6 @@@ int jffs2_check_nand_cleanmarker (struc
                return 2;
        }
  
 -      ops.len = oobsize;
        ops.ooblen = oobsize;
        ops.oobbuf = c->oobbuf;
        ops.ooboffs = 0;
                return ret;
        }
  
 -      if (ops.retlen < ops.len) {
 +      if (ops.oobretlen < ops.ooblen) {
                D1 (printk (KERN_WARNING "jffs2_check_nand_cleanmarker(): "
                            "Read OOB return short read (%zd bytes not %d) "
 -                          "for block at %08x\n", ops.retlen, ops.len,
 +                          "for block at %08x\n", ops.oobretlen, ops.ooblen,
                            jeb->offset));
                return -EIO;
        }
@@@ -1087,7 -1090,8 +1088,7 @@@ int jffs2_write_nand_cleanmarker(struc
        n.nodetype = cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER);
        n.totlen = cpu_to_je32(8);
  
 -      ops.len = c->fsdata_len;
 -      ops.ooblen = c->fsdata_len;;
 +      ops.ooblen = c->fsdata_len;
        ops.oobbuf = (uint8_t *)&n;
        ops.ooboffs = c->fsdata_pos;
        ops.datbuf = NULL;
                          jeb->offset, ret));
                return ret;
        }
 -      if (ops.retlen != ops.len) {
 +      if (ops.oobretlen != ops.ooblen) {
                D1(printk(KERN_WARNING "jffs2_write_nand_cleanmarker(): "
                          "Short write for block at %08x: %zd not %d\n",
 -                        jeb->offset, ops.retlen, ops.len));
 +                        jeb->offset, ops.oobretlen, ops.ooblen));
                return -EIO;
        }
        return 0;