]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
authorDavid Woodhouse <dwmw2@infradead.org>
Mon, 26 Jun 2006 15:35:44 +0000 (16:35 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Mon, 26 Jun 2006 15:35:44 +0000 (16:35 +0100)
14 files changed:
drivers/mtd/chips/cfi_cmdset_0001.c
drivers/mtd/chips/jedec.c
drivers/mtd/chips/map_absent.c
drivers/mtd/chips/map_ram.c
drivers/mtd/chips/map_rom.c
drivers/mtd/devices/block2mtd.c
drivers/mtd/devices/ms02-nv.c
drivers/mtd/devices/mtd_dataflash.c
drivers/mtd/devices/phram.c
drivers/mtd/devices/pmc551.c
drivers/mtd/devices/slram.c
drivers/mtd/nand/nand_base.c
drivers/mtd/nand/ndfc.c
drivers/mtd/nand/s3c2410.c

index 0d435814aaa137aba3274696c0a118515f155fa4..39edb8250fbc13f85f23347f6aff7b9a0c20d6a4 100644 (file)
@@ -357,6 +357,7 @@ struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary)
        mtd->resume  = cfi_intelext_resume;
        mtd->flags   = MTD_CAP_NORFLASH;
        mtd->name    = map->name;
+       mtd->writesize = 1;
 
        mtd->reboot_notifier.notifier_call = cfi_intelext_reboot;
 
index c40b48dabed362c00a5bc2c001a75d2131a6b05c..2c3f019197c116463b74b04645dd6baf54e0dd65 100644 (file)
@@ -256,6 +256,7 @@ static struct mtd_info *jedec_probe(struct map_info *map)
    MTD->name = map->name;
    MTD->type = MTD_NORFLASH;
    MTD->flags = MTD_CAP_NORFLASH;
+   MTD->writesize = 1;
    MTD->erasesize = SectorSize*(map->buswidth);
    //   printk("MTD->erasesize is %x\n",(unsigned int)MTD->erasesize);
    MTD->size = priv->size;
index a611de9b15159349116d78d28fdb2968b29f2c62..ac01a949b687a4513e7217c0c59ac1f492d06a45 100644 (file)
@@ -64,7 +64,8 @@ static struct mtd_info *map_absent_probe(struct map_info *map)
        mtd->write      = map_absent_write;
        mtd->sync       = map_absent_sync;
        mtd->flags      = 0;
-       mtd->erasesize = PAGE_SIZE;
+       mtd->erasesize  = PAGE_SIZE;
+       mtd->writesize  = 1;
 
        __module_get(THIS_MODULE);
        return mtd;
index 763925747db6f60a6701aad1b68e2fdecb801457..3a66680abfd06cc3b3c6b60e129e957d84e912a9 100644 (file)
@@ -71,6 +71,7 @@ static struct mtd_info *map_ram_probe(struct map_info *map)
        mtd->write = mapram_write;
        mtd->sync = mapram_nop;
        mtd->flags = MTD_CAP_RAM;
+       mtd->writesize = 1;
 
        mtd->erasesize = PAGE_SIZE;
        while(mtd->size & (mtd->erasesize - 1))
index bc6ee9ef8a31ac8d6a44ef054d9d0a33d9dc9a23..1b328b1378fda2d9d288d535434a7113a7262d74 100644 (file)
@@ -47,6 +47,7 @@ static struct mtd_info *map_rom_probe(struct map_info *map)
        mtd->sync = maprom_nop;
        mtd->flags = MTD_CAP_ROM;
        mtd->erasesize = map->size;
+       mtd->writesize = 1;
 
        __module_get(THIS_MODULE);
        return mtd;
index 0d98c223c5fc2e188d1f1e58ad0ea53ca0d1a506..be3f1c136d0211340a5b890b0f5648dd07c10777 100644 (file)
@@ -324,6 +324,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size)
 
        dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK;
        dev->mtd.erasesize = erase_size;
+       dev->mtd.writesize = 1;
        dev->mtd.type = MTD_RAM;
        dev->mtd.flags = MTD_CAP_RAM;
        dev->mtd.erase = block2mtd_erase;
index 4ab7670770e43ff1cc9a0d855b872e1c22656f1e..08dfb899b27204ef036e693826643bd6452d8f38 100644 (file)
@@ -225,6 +225,7 @@ static int __init ms02nv_init_one(ulong addr)
        mtd->owner = THIS_MODULE;
        mtd->read = ms02nv_read;
        mtd->write = ms02nv_write;
+       mtd->writesize = 1;
 
        ret = -EIO;
        if (add_mtd_device(mtd)) {
index a19480d07888dfd043872b2e5d715755851a17e8..04271d02b6b6d990c1c32d363bea309792dbde4a 100644 (file)
@@ -478,6 +478,7 @@ add_dataflash(struct spi_device *spi, char *name,
        device->name = (pdata && pdata->name) ? pdata->name : priv->name;
        device->size = nr_pages * pagesize;
        device->erasesize = pagesize;
+       device->writesize = pagesize;
        device->owner = THIS_MODULE;
        device->type = MTD_DATAFLASH;
        device->flags = MTD_CAP_NORFLASH;
index e09e416667d38daea36e24b8034daa86597adb79..6c7337f9ebbbfce6edc1f204f1d1b58d6bff2be5 100644 (file)
@@ -151,6 +151,7 @@ static int register_device(char *name, unsigned long start, unsigned long len)
        new->mtd.owner = THIS_MODULE;
        new->mtd.type = MTD_RAM;
        new->mtd.erasesize = PAGE_SIZE;
+       new->mtd.writesize = 1;
 
        ret = -EAGAIN;
        if (add_mtd_device(&new->mtd)) {
index 666cce1bf60c0dddea6df065f47c89cd22330ef9..f620d74f10042449ae077f632eaeacb423717f13 100644 (file)
@@ -778,7 +778,8 @@ static int __init init_pmc551(void)
                 mtd->type      = MTD_RAM;
                 mtd->name      = "PMC551 RAM board";
                 mtd->erasesize         = 0x10000;
-               mtd->owner = THIS_MODULE;
+                mtd->writesize  = 1;
+                mtd->owner = THIS_MODULE;
 
                 if (add_mtd_device(mtd)) {
                         printk(KERN_NOTICE "pmc551: Failed to register new device\n");
index b3f665e3c38bfeec5fade51e3c4fb77ee61bc7b4..542a0c009006d4b682d30c03fa437a4f0b62a2aa 100644 (file)
@@ -209,6 +209,7 @@ static int register_device(char *name, unsigned long start, unsigned long length
        (*curmtd)->mtdinfo->owner = THIS_MODULE;
        (*curmtd)->mtdinfo->type = MTD_RAM;
        (*curmtd)->mtdinfo->erasesize = SLRAM_BLK_SZ;
+       (*curmtd)->mtdinfo->writesize = 1;
 
        if (add_mtd_device((*curmtd)->mtdinfo)) {
                E("slram: Failed to register new device\n");
index 27083ed0a017a6af2da8d41ad48d466e7b98a86d..8df184f6d8d1682eb71849c395a7e74a7ed31a68 100644 (file)
@@ -1176,7 +1176,7 @@ static int nand_write_oob_std(struct mtd_info *mtd, struct nand_chip *chip,
 
        status = chip->waitfunc(mtd, chip);
 
-       return status;
+       return status & NAND_STATUS_FAIL ? -EIO : 0;
 }
 
 /**
@@ -1271,10 +1271,6 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
                sndcmd = chip->ecc.read_oob(mtd, chip, page, sndcmd);
                buf = nand_transfer_oob(chip, buf, ops);
 
-               readlen -= ops->ooblen;
-               if (!readlen)
-                       break;
-
                if (!(chip->options & NAND_NO_READRDY)) {
                        /*
                         * Apply delay or wait for ready/busy pin. Do this
@@ -1288,6 +1284,10 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
                                nand_wait_ready(mtd);
                }
 
+               readlen -= ops->ooblen;
+               if (!readlen)
+                       break;
+
                /* Increment page address */
                realpage++;
 
index fe8d38514ba655ce79e8b4bc788726a5e6e060d5..e5bd88f2d560ae3966fe5169c6885c5c0d4d235f 100644 (file)
@@ -61,15 +61,15 @@ static void ndfc_select_chip(struct mtd_info *mtd, int chip)
 
 static void ndfc_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
 {
-       struct nand_chip *chip = mtd->priv;
+       struct ndfc_controller *ndfc = &ndfc_ctrl;
 
        if (cmd == NAND_CMD_NONE)
                return;
 
        if (ctrl & NAND_CLE)
-               writel(cmd & 0xFF, chip->IO_ADDR_W + NDFC_CMD);
+               writel(cmd & 0xFF, ndfc->ndfcbase + NDFC_CMD);
        else
-               writel(cmd & 0xFF, chip->IO_ADDR_W + NDFC_ALE);
+               writel(cmd & 0xFF, ndfc->ndfcbase + NDFC_ALE);
 }
 
 static int ndfc_ready(struct mtd_info *mtd)
index 2c262fe03d8af60a93bd6cda681246bf4b7d9ce6..5219bd212cf6b7ddf9cda3c8bc89346bf0eba4b3 100644 (file)
@@ -63,8 +63,6 @@
 #include <asm/arch/regs-nand.h>
 #include <asm/arch/nand.h>
 
-#define PFX "s3c2410-nand: "
-
 #ifdef CONFIG_MTD_NAND_S3C2410_HWECC
 static int hardware_ecc = 1;
 #else
@@ -195,11 +193,11 @@ static int s3c2410_nand_inithw(struct s3c2410_nand_info *info, struct platform_d
        }
 
        if (tacls < 0 || twrph0 < 0 || twrph1 < 0) {
-               printk(KERN_ERR PFX "cannot get timings suitable for board\n");
+               dev_err(info->device, "cannot get suitable timings\n");
                return -EINVAL;
        }
 
-       printk(KERN_INFO PFX "Tacls=%d, %dns Twrph0=%d %dns, Twrph1=%d %dns\n",
+       dev_info(info->device, "Tacls=%d, %dns Twrph0=%d %dns, Twrph1=%d %dns\n",
               tacls, to_ns(tacls, clkrate), twrph0, to_ns(twrph0, clkrate), twrph1, to_ns(twrph1, clkrate));
 
        if (!info->is_s3c2440) {
@@ -218,7 +216,7 @@ static int s3c2410_nand_inithw(struct s3c2410_nand_info *info, struct platform_d
                       info->regs + S3C2440_NFCONT);
        }
 
-       pr_debug(PFX "NF_CONF is 0x%lx\n", cfg);
+       dev_dbg(info->device, "NF_CONF is 0x%lx\n", cfg);
 
        writel(cfg, info->regs + S3C2410_NFCONF);
        return 0;
@@ -250,7 +248,7 @@ static void s3c2410_nand_select_chip(struct mtd_info *mtd, int chip)
                cur |= bit;
        } else {
                if (nmtd->set != NULL && chip > nmtd->set->nr_chips) {
-                       printk(KERN_ERR PFX "chip %d out of range\n", chip);
+                       dev_err(info->device, "invalid chip %d\n", chip);
                        return;
                }