projects/linux·commit ebcccd14

Merge git://git.infradead.org/mtd-2.6

ebcccd14 · Linus Torvalds <[email protected]> · 2007-01-22 19:32:13 -08:00

* git://git.infradead.org/mtd-2.6: (84 commits)
  [JFFS2] debug.h: include <linux/sched.h> for current->pid
  [MTD] OneNAND: Handle DDP chip boundary during read-while-load
  [MTD] OneNAND: return ecc error code only when 2-bit ecc occurs
  [MTD] OneNAND: Implement read-while-load
  [MTD] OneNAND: fix onenand_wait bug in read ecc error
  [MTD] OneNAND: release CPU in cycles
  [MTD] OneNAND: add subpage write support
  [MTD] OneNAND: fix onenand_wait bug
  [JFFS2] use the ref_offset macro
  [JFFS2] Reschedule in loops
  [JFFS2] Fix error-path leak in summary scan
  [JFFS2] add cond_resched() when garbage collecting deletion dirent
  [MTD] Nuke IVR leftovers
  [MTD] OneNAND: fix oob handling in recent oob patch
  [MTD] Fix ssfdc blksize typo
  [JFFS2] replace kmalloc+memset with kzalloc
  [MTD] Fix SSFDC build for variable blocksize.
  [MTD] ESB2ROM uses PCI
  [MTD] of_device-based physmap driver
  [MTD] Support combined RedBoot FIS directory and configuration area
  ...
Commit
ebcccd14b73831fa7fbc197e1d2b9c710a65731e
Parents
e0015489 · 9cdf083f

Merge commit. Changes below are compared with the first parent: e0015489.

Changes

87 files changed · +4404 −868

FileStatusAddDelContent
arch/ppc/platforms/ev64360.cmodified+1−2View file
drivers/mtd/Kconfigmodified+13−2View file
drivers/mtd/Makefilemodified+8−7View file
drivers/mtd/afs.cmodified+1−2View file
drivers/mtd/chips/amd_flash.cmodified+1−2View file
drivers/mtd/chips/cfi_cmdset_0001.cmodified+3−2View file
drivers/mtd/chips/cfi_cmdset_0002.cmodified+7−4View file
drivers/mtd/chips/cfi_cmdset_0020.cmodified+1−2View file
drivers/mtd/chips/gen_probe.cmodified+2−3View file
drivers/mtd/chips/jedec.cmodified+1−2View file
drivers/mtd/chips/jedec_probe.cmodified+16−1View file
drivers/mtd/chips/map_absent.cmodified+1−3View file
drivers/mtd/chips/map_ram.cmodified+1−3View file
drivers/mtd/chips/map_rom.cmodified+1−3View file
drivers/mtd/chips/sharp.cmodified+2−5View file
drivers/mtd/cmdlinepart.cmodified+2−3View file
drivers/mtd/devices/block2mtd.cmodified+1−2View file
drivers/mtd/devices/ms02-nv.cmodified+6−12View file
drivers/mtd/devices/mtd_dataflash.cmodified+1−1View file
drivers/mtd/devices/phram.cmodified+1−3View file
drivers/mtd/devices/slram.cmodified+2−5View file
drivers/mtd/ftl.cmodified+3−4View file
drivers/mtd/inftlcore.cmodified+5−7View file
drivers/mtd/maps/Kconfigmodified+27−44View file
drivers/mtd/maps/Makefilemodified+3−1View file
drivers/mtd/maps/amd76xrom.cmodified+28−6View file
drivers/mtd/maps/bast-flash.cmodified+1−1View file
drivers/mtd/maps/ceiva.cmodified+1−2View file
drivers/mtd/maps/ck804xrom.cadded+356−0View file
drivers/mtd/maps/cstm_mips_ixx.cdeleted+0−283View before deletion
drivers/mtd/maps/esb2rom.cadded+450−0View file
drivers/mtd/maps/integrator-flash.cmodified+1−3View file
drivers/mtd/maps/nettel.cmodified+3−2View file
drivers/mtd/maps/omap_nor.cmodified+1−3View file
drivers/mtd/maps/pcmciamtd.cmodified+1−2View file
drivers/mtd/maps/physmap.cmodified+2−3View file
drivers/mtd/maps/physmap_of.cadded+255−0View file
drivers/mtd/maps/plat-ram.cmodified+1−2View file
drivers/mtd/maps/sa1100-flash.cmodified+1−3View file
drivers/mtd/maps/tqm834x.cmodified+2−6View file
drivers/mtd/maps/tqm8xxl.cmodified+1−2View file
drivers/mtd/mtd_blkdevs.cmodified+10−9View file
drivers/mtd/mtdblock.cmodified+4−6View file
drivers/mtd/mtdblock_ro.cmodified+3−4View file
drivers/mtd/mtdchar.cmodified+11−12View file
drivers/mtd/mtdconcat.cmodified+26−17View file
drivers/mtd/mtdcore.cmodified+78−15View file
drivers/mtd/mtdpart.cmodified+4−4View file
drivers/mtd/nand/Kconfigmodified+16−0View file
drivers/mtd/nand/Makefilemodified+4−1View file
drivers/mtd/nand/at91_nand.cadded+223−0View file
drivers/mtd/nand/cafe.cadded+770−0View file
drivers/mtd/nand/cafe_ecc.cadded+1381−0View file
drivers/mtd/nand/cs553x_nand.cmodified+2−2View file
drivers/mtd/nand/diskonchip.cmodified+1−2View file
drivers/mtd/nand/nand_base.cmodified+91−42View file
drivers/mtd/nand/nand_bbt.cmodified+4−7View file
drivers/mtd/nand/nand_ecc.cmodified+2−2View file
drivers/mtd/nand/nandsim.cmodified+158−85View file
drivers/mtd/nand/ndfc.cmodified+1−1View file
drivers/mtd/nand/rtc_from4.cmodified+3−43View file
drivers/mtd/nand/s3c2410.cmodified+1−1View file
drivers/mtd/nftlcore.cmodified+5−7View file
drivers/mtd/onenand/generic.cmodified+2−3View file
drivers/mtd/onenand/onenand_base.cmodified+283−91View file
drivers/mtd/onenand/onenand_bbt.cmodified+6−8View file
drivers/mtd/redboot.cmodified+24−6View file
drivers/mtd/rfd_ftl.cmodified+2−1View file
drivers/mtd/ssfdc.cmodified+3−4View file
fs/jffs/jffs_fm.cmodified+2−1View file
fs/jffs2/debug.cmodified+2−2View file
fs/jffs2/debug.hmodified+1−0View file
fs/jffs2/fs.cmodified+1−2View file
fs/jffs2/gc.cmodified+2−0View file
fs/jffs2/nodelist.hmodified+4−6View file
fs/jffs2/readinode.cmodified+1−2View file
fs/jffs2/scan.cmodified+4−2View file
fs/jffs2/summary.cmodified+3−3View file
fs/jffs2/super.cmodified+4−3View file
fs/jffs2/symlink.cmodified+1−1View file
fs/jffs2/wbuf.cmodified+9−12View file
fs/jffs2/xattr.cmodified+2−3View file
include/linux/mtd/blktrans.hmodified+2−1View file
include/linux/mtd/mtd.hmodified+16−8View file
include/linux/mtd/nand.hmodified+10−5View file
include/linux/mtd/onenand.hmodified+7−1View file
include/linux/mtd/onenand_regs.hmodified+1−0View file

Only the first 600 diff lines are shown. Download the complete patch.

arch/ppc/platforms/ev64360.c

View file
diff --git a/arch/ppc/platforms/ev64360.c b/arch/ppc/platforms/ev64360.c
index 90ed375..f87e06f 100644
--- a/arch/ppc/platforms/ev64360.c
+++ b/arch/ppc/platforms/ev64360.c
@@ -358,13 +358,12 @@ ev64360_setup_mtd(void)
ptbl_entries = 3;
- if ((ptbl = kmalloc(ptbl_entries * sizeof(struct mtd_partition),
+ if ((ptbl = kzalloc(ptbl_entries * sizeof(struct mtd_partition),
GFP_KERNEL)) == NULL) {
printk(KERN_WARNING "Can't alloc MTD partition table\n");
return -ENOMEM;
}
- memset(ptbl, 0, ptbl_entries * sizeof(struct mtd_partition));
ptbl[0].name = "reserved";
ptbl[0].offset = 0;

drivers/mtd/Kconfig

View file
diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index a304b34..26f75c2 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -164,9 +164,15 @@ config MTD_CHAR
memory chips, and also use ioctl() to obtain information about
the device, or to erase parts of it.
+config MTD_BLKDEVS
+ tristate "Common interface to block layer for MTD 'translation layers'"
+ depends on MTD && BLOCK
+ default n
+
config MTD_BLOCK
tristate "Caching block device access to MTD devices"
depends on MTD && BLOCK
+ select MTD_BLKDEVS
---help---
Although most flash chips have an erase size too large to be useful
as block devices, it is possible to use MTD devices which are based
@@ -189,6 +195,7 @@ config MTD_BLOCK
config MTD_BLOCK_RO
tristate "Readonly block device access to MTD devices"
depends on MTD_BLOCK!=y && MTD && BLOCK
+ select MTD_BLKDEVS
help
This allows you to mount read-only file systems (such as cramfs)
from an MTD device, without the overhead (and danger) of the caching
@@ -200,6 +207,7 @@ config MTD_BLOCK_RO
config FTL
tristate "FTL (Flash Translation Layer) support"
depends on MTD && BLOCK
+ select MTD_BLKDEVS
---help---
This provides support for the original Flash Translation Layer which
is part of the PCMCIA specification. It uses a kind of pseudo-
@@ -216,6 +224,7 @@ config FTL
config NFTL
tristate "NFTL (NAND Flash Translation Layer) support"
depends on MTD && BLOCK
+ select MTD_BLKDEVS
---help---
This provides support for the NAND Flash Translation Layer which is
used on M-Systems' DiskOnChip devices. It uses a kind of pseudo-
@@ -239,6 +248,7 @@ config NFTL_RW
config INFTL
tristate "INFTL (Inverse NAND Flash Translation Layer) support"
depends on MTD && BLOCK
+ select MTD_BLKDEVS
---help---
This provides support for the Inverse NAND Flash Translation
Layer which is used on M-Systems' newer DiskOnChip devices. It
@@ -256,6 +266,7 @@ config INFTL
config RFD_FTL
tristate "Resident Flash Disk (Flash Translation Layer) support"
depends on MTD && BLOCK
+ select MTD_BLKDEVS
---help---
This provides support for the flash translation layer known
as the Resident Flash Disk (RFD), as used by the Embedded BIOS
@@ -265,8 +276,8 @@ config RFD_FTL
config SSFDC
tristate "NAND SSFDC (SmartMedia) read only translation layer"
- depends on MTD
- default n
+ depends on MTD && BLOCK
+ select MTD_BLKDEVS
help
This enables read only access to SmartMedia formatted NAND
flash. You can mount it with FAT file system.

drivers/mtd/Makefile

View file
diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
index 1e36b9a..c130e62 100644
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -15,13 +15,14 @@ obj-$(CONFIG_MTD_AFS_PARTS) += afs.o
# 'Users' - code which presents functionality to userspace.
obj-$(CONFIG_MTD_CHAR) += mtdchar.o
-obj-$(CONFIG_MTD_BLOCK) += mtdblock.o mtd_blkdevs.o
-obj-$(CONFIG_MTD_BLOCK_RO) += mtdblock_ro.o mtd_blkdevs.o
-obj-$(CONFIG_FTL) += ftl.o mtd_blkdevs.o
-obj-$(CONFIG_NFTL) += nftl.o mtd_blkdevs.o
-obj-$(CONFIG_INFTL) += inftl.o mtd_blkdevs.o
-obj-$(CONFIG_RFD_FTL) += rfd_ftl.o mtd_blkdevs.o
-obj-$(CONFIG_SSFDC) += ssfdc.o mtd_blkdevs.o
+obj-$(CONFIG_MTD_BLKDEVS) += mtd_blkdevs.o
+obj-$(CONFIG_MTD_BLOCK) += mtdblock.o
+obj-$(CONFIG_MTD_BLOCK_RO) += mtdblock_ro.o
+obj-$(CONFIG_FTL) += ftl.o
+obj-$(CONFIG_NFTL) += nftl.o
+obj-$(CONFIG_INFTL) += inftl.o
+obj-$(CONFIG_RFD_FTL) += rfd_ftl.o
+obj-$(CONFIG_SSFDC) += ssfdc.o
nftl-objs := nftlcore.o nftlmount.o
inftl-objs := inftlcore.o inftlmount.o

drivers/mtd/afs.c

View file
diff --git a/drivers/mtd/afs.c b/drivers/mtd/afs.c
index 6a45be0..52d51eb 100644
--- a/drivers/mtd/afs.c
+++ b/drivers/mtd/afs.c
@@ -207,11 +207,10 @@ static int parse_afs_partitions(struct mtd_info *mtd,
if (!sz)
return ret;
- parts = kmalloc(sz, GFP_KERNEL);
+ parts = kzalloc(sz, GFP_KERNEL);
if (!parts)
return -ENOMEM;
- memset(parts, 0, sz);
str = (char *)(parts + idx);
/*

drivers/mtd/chips/amd_flash.c

View file
diff --git a/drivers/mtd/chips/amd_flash.c b/drivers/mtd/chips/amd_flash.c
index 16eaca6..e7999f1 100644
--- a/drivers/mtd/chips/amd_flash.c
+++ b/drivers/mtd/chips/amd_flash.c
@@ -643,13 +643,12 @@ static struct mtd_info *amd_flash_probe(struct map_info *map)
int reg_idx;
int offset;
- mtd = (struct mtd_info*)kmalloc(sizeof(*mtd), GFP_KERNEL);
+ mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
if (!mtd) {
printk(KERN_WARNING
"%s: kmalloc failed for info structure\n", map->name);
return NULL;
}
- memset(mtd, 0, sizeof(*mtd));
mtd->priv = map;
memset(&temp, 0, sizeof(temp));

drivers/mtd/chips/cfi_cmdset_0001.c

View file
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index 296159e..f69184a 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -337,12 +337,11 @@ struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary)
struct mtd_info *mtd;
int i;
- mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
+ mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
if (!mtd) {
printk(KERN_ERR "Failed to allocate memory for MTD device\n");
return NULL;
}
- memset(mtd, 0, sizeof(*mtd));
mtd->priv = map;
mtd->type = MTD_NORFLASH;
@@ -2224,6 +2223,8 @@ static int cfi_intelext_suspend(struct mtd_info *mtd)
case FL_CFI_QUERY:
case FL_JEDEC_QUERY:
if (chip->oldstate == FL_READY) {
+ /* place the chip in a known state before suspend */
+ map_write(map, CMD(0xFF), cfi->chips[i].start);
chip->oldstate = chip->state;
chip->state = FL_PM_SUSPENDED;
/* No need to wake_up() on this state change -

drivers/mtd/chips/cfi_cmdset_0002.c

View file
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index 702ae4c..e3acd39 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -48,6 +48,7 @@
#define MANUFACTURER_ATMEL 0x001F
#define MANUFACTURER_SST 0x00BF
#define SST49LF004B 0x0060
+#define SST49LF040B 0x0050
#define SST49LF008A 0x005a
#define AT49BV6416 0x00d6
@@ -233,6 +234,7 @@ static struct cfi_fixup cfi_fixup_table[] = {
};
static struct cfi_fixup jedec_fixup_table[] = {
{ MANUFACTURER_SST, SST49LF004B, fixup_use_fwh_lock, NULL, },
+ { MANUFACTURER_SST, SST49LF040B, fixup_use_fwh_lock, NULL, },
{ MANUFACTURER_SST, SST49LF008A, fixup_use_fwh_lock, NULL, },
{ 0, 0, NULL, NULL }
};
@@ -255,12 +257,11 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
struct mtd_info *mtd;
int i;
- mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
+ mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
if (!mtd) {
printk(KERN_WARNING "Failed to allocate memory for MTD device\n");
return NULL;
}
- memset(mtd, 0, sizeof(*mtd));
mtd->priv = map;
mtd->type = MTD_NORFLASH;
@@ -519,10 +520,12 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr
if (mode == FL_WRITING) /* FIXME: Erase-suspend-program appears broken. */
goto sleep;
- if (!(mode == FL_READY || mode == FL_POINT
+ if (!( mode == FL_READY
+ || mode == FL_POINT
|| !cfip
|| (mode == FL_WRITING && (cfip->EraseSuspend & 0x2))
- || (mode == FL_WRITING && (cfip->EraseSuspend & 0x1))))
+ || (mode == FL_WRITING && (cfip->EraseSuspend & 0x1)
+ )))
goto sleep;
/* We could check to see if we're trying to access the sector

drivers/mtd/chips/cfi_cmdset_0020.c

View file
diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c
index fae70a5..d56849f 100644
--- a/drivers/mtd/chips/cfi_cmdset_0020.c
+++ b/drivers/mtd/chips/cfi_cmdset_0020.c
@@ -172,7 +172,7 @@ static struct mtd_info *cfi_staa_setup(struct map_info *map)
int i,j;
unsigned long devsize = (1<<cfi->cfiq->DevSize) * cfi->interleave;
- mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
+ mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
//printk(KERN_DEBUG "number of CFI chips: %d\n", cfi->numchips);
if (!mtd) {
@@ -181,7 +181,6 @@ static struct mtd_info *cfi_staa_setup(struct map_info *map)
return NULL;
}
- memset(mtd, 0, sizeof(*mtd));
mtd->priv = map;
mtd->type = MTD_NORFLASH;
mtd->size = devsize * cfi->numchips;

drivers/mtd/chips/gen_probe.c

View file
diff --git a/drivers/mtd/chips/gen_probe.c b/drivers/mtd/chips/gen_probe.c
index cdb0f59..2eb696d 100644
--- a/drivers/mtd/chips/gen_probe.c
+++ b/drivers/mtd/chips/gen_probe.c
@@ -40,7 +40,7 @@ struct mtd_info *mtd_do_chip_probe(struct map_info *map, struct chip_probe *cp)
if (mtd) {
if (mtd->size > map->size) {
printk(KERN_WARNING "Reducing visibility of %ldKiB chip to %ldKiB\n",
- (unsigned long)mtd->size >> 10,
+ (unsigned long)mtd->size >> 10,
(unsigned long)map->size >> 10);
mtd->size = map->size;
}
@@ -113,13 +113,12 @@ static struct cfi_private *genprobe_ident_chips(struct map_info *map, struct chi
}
mapsize = (max_chips + BITS_PER_LONG-1) / BITS_PER_LONG;
- chip_map = kmalloc(mapsize, GFP_KERNEL);
+ chip_map = kzalloc(mapsize, GFP_KERNEL);
if (!chip_map) {
printk(KERN_WARNING "%s: kmalloc failed for CFI chip map\n", map->name);
kfree(cfi.cfiq);
return NULL;
}
- memset (chip_map, 0, mapsize);
set_bit(0, chip_map); /* Mark first chip valid */

drivers/mtd/chips/jedec.c

View file
diff --git a/drivers/mtd/chips/jedec.c b/drivers/mtd/chips/jedec.c
index 2c3f019..14e57b2 100644
--- a/drivers/mtd/chips/jedec.c
+++ b/drivers/mtd/chips/jedec.c
@@ -116,11 +116,10 @@ static struct mtd_info *jedec_probe(struct map_info *map)
char Part[200];
memset(&priv,0,sizeof(priv));
- MTD = kmalloc(sizeof(struct mtd_info) + sizeof(struct jedec_private), GFP_KERNEL);
+ MTD = kzalloc(sizeof(struct mtd_info) + sizeof(struct jedec_private), GFP_KERNEL);
if (!MTD)
return NULL;
- memset(MTD, 0, sizeof(struct mtd_info) + sizeof(struct jedec_private));
priv = (struct jedec_private *)&MTD[1];
my_bank_size = map->size;

drivers/mtd/chips/jedec_probe.c

View file
diff --git a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c
index 1154dac..58e561e 100644
--- a/drivers/mtd/chips/jedec_probe.c
+++ b/drivers/mtd/chips/jedec_probe.c
@@ -154,6 +154,7 @@
#define SST39SF010A 0x00B5
#define SST39SF020A 0x00B6
#define SST49LF004B 0x0060
+#define SST49LF040B 0x0050
#define SST49LF008A 0x005a
#define SST49LF030A 0x001C
#define SST49LF040A 0x0051
@@ -1401,6 +1402,20 @@ static const struct amd_flash_info jedec_table[] = {
}
}, {
.mfr_id = MANUFACTURER_SST,
+ .dev_id = SST49LF040B,
+ .name = "SST 49LF040B",
+ .uaddr = {
+ [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
+ },
+ .DevSize = SIZE_512KiB,
+ .CmdSet = P_ID_AMD_STD,
+ .NumEraseRegions= 1,
+ .regions = {
+ ERASEINFO(0x01000,128),
+ }
+ }, {
+
+ .mfr_id = MANUFACTURER_SST,
.dev_id = SST49LF004B,
.name = "SST 49LF004B",
.uaddr = {
@@ -1874,7 +1889,7 @@ static int cfi_jedec_setup(struct cfi_private *p_cfi, int index)
/*
- * There is a BIG problem properly ID'ing the JEDEC devic and guaranteeing
+ * There is a BIG problem properly ID'ing the JEDEC device and guaranteeing
* the mapped address, unlock addresses, and proper chip ID. This function
* attempts to minimize errors. It is doubtfull that this probe will ever
* be perfect - consequently there should be some module parameters that

drivers/mtd/chips/map_absent.c

View file
diff --git a/drivers/mtd/chips/map_absent.c b/drivers/mtd/chips/map_absent.c
index ac01a94..fc478c0 100644
--- a/drivers/mtd/chips/map_absent.c
+++ b/drivers/mtd/chips/map_absent.c
@@ -47,13 +47,11 @@ static struct mtd_info *map_absent_probe(struct map_info *map)
{
struct mtd_info *mtd;
- mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
+ mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
if (!mtd) {
return NULL;
}
- memset(mtd, 0, sizeof(*mtd));
-
map->fldrv = &map_absent_chipdrv;
mtd->priv = map;
mtd->name = map->name;

drivers/mtd/chips/map_ram.c

View file
diff --git a/drivers/mtd/chips/map_ram.c b/drivers/mtd/chips/map_ram.c
index 3a66680..5cb6d52 100644
--- a/drivers/mtd/chips/map_ram.c
+++ b/drivers/mtd/chips/map_ram.c
@@ -55,12 +55,10 @@ static struct mtd_info *map_ram_probe(struct map_info *map)
#endif
/* OK. It seems to be RAM. */
- mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
+ mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
if (!mtd)
return NULL;
- memset(mtd, 0, sizeof(*mtd));
-
map->fldrv = &mapram_chipdrv;
mtd->priv = map;
mtd->name = map->name;

drivers/mtd/chips/map_rom.c

View file
diff --git a/drivers/mtd/chips/map_rom.c b/drivers/mtd/chips/map_rom.c
index 1b328b1..cb27f85 100644
--- a/drivers/mtd/chips/map_rom.c
+++ b/drivers/mtd/chips/map_rom.c
@@ -31,12 +31,10 @@ static struct mtd_info *map_rom_probe(struct map_info *map)
{
struct mtd_info *mtd;
- mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
+ mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
if (!mtd)
return NULL;
- memset(mtd, 0, sizeof(*mtd));
-
map->fldrv = &maprom_chipdrv;
mtd->priv = map;
mtd->name = map->name;

drivers/mtd/chips/sharp.c

View file
diff --git a/drivers/mtd/chips/sharp.c b/drivers/mtd/chips/sharp.c
index 967abbe..c9cd3d2 100644
--- a/drivers/mtd/chips/sharp.c
+++ b/drivers/mtd/chips/sharp.c
@@ -112,18 +112,16 @@ static struct mtd_info *sharp_probe(struct map_info *map)
struct sharp_info *sharp = NULL;
int width;
- mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
+ mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
if(!mtd)
return NULL;
- sharp = kmalloc(sizeof(*sharp), GFP_KERNEL);
+ sharp = kzalloc(sizeof(*sharp), GFP_KERNEL);
if(!sharp) {
kfree(mtd);
return NULL;
}
- memset(mtd, 0, sizeof(*mtd));
-
width = sharp_probe_map(map,mtd);
if(!width){
kfree(mtd);
@@ -143,7 +141,6 @@ static struct mtd_info *sharp_probe(struct map_info *map)
mtd->writesize = 1;
mtd->name = map->name;
- memset(sharp, 0, sizeof(*sharp));
sharp->chipshift = 23;
sharp->numchips = 1;
sharp->chips[0].start = 0;

drivers/mtd/cmdlinepart.c

View file
diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c
index a7a7bfe..23fab14 100644
--- a/drivers/mtd/cmdlinepart.c
+++ b/drivers/mtd/cmdlinepart.c
@@ -163,13 +163,12 @@ static struct mtd_partition * newpart(char *s,
*num_parts = this_part + 1;
alloc_size = *num_parts * sizeof(struct mtd_partition) +
extra_mem_size;
- parts = kmalloc(alloc_size, GFP_KERNEL);
+ parts = kzalloc(alloc_size, GFP_KERNEL);
if (!parts)
{
printk(KERN_ERR ERRP "out of memory\n");
return NULL;
}
- memset(parts, 0, alloc_size);
extra_mem = (unsigned char *)(parts + *num_parts);
}
/* enter this partition (offset will be calculated later if it is zero at this point) */
@@ -346,7 +345,7 @@ static int parse_cmdline_partitions(struct mtd_info *master,
*
* This function needs to be visible for bootloaders.
*/
-int mtdpart_setup(char *s)
+static int mtdpart_setup(char *s)
{
cmdline = s;
return 1;

drivers/mtd/devices/block2mtd.c

View file
diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
index 401c6a2..6d917a4 100644
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -295,10 +295,9 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size)
if (!devname)
return NULL;
- dev = kmalloc(sizeof(struct block2mtd_dev), GFP_KERNEL);
+ dev = kzalloc(sizeof(struct block2mtd_dev), GFP_KERNEL);
if (!dev)
return NULL;
- memset(dev, 0, sizeof(*dev));
/* Get a handle on the device */
bdev = open_bdev_excl(devname, O_RDWR, NULL);

drivers/mtd/devices/ms02-nv.c

View file
diff --git a/drivers/mtd/devices/ms02-nv.c b/drivers/mtd/devices/ms02-nv.c
index 08dfb89..9cff119 100644
--- a/drivers/mtd/devices/ms02-nv.c
+++ b/drivers/mtd/devices/ms02-nv.c
@@ -131,11 +131,10 @@ static int __init ms02nv_init_one(ulong addr)
int ret = -ENODEV;
/* The module decodes 8MiB of address space. */
- mod_res = kmalloc(sizeof(*mod_res), GFP_KERNEL);
+ mod_res = kzalloc(sizeof(*mod_res), GFP_KERNEL);
if (!mod_res)
return -ENOMEM;
- memset(mod_res, 0, sizeof(*mod_res));
mod_res->name = ms02nv_name;
mod_res->start = addr;
mod_res->end = addr + MS02NV_SLOT_SIZE - 1;
@@ -153,24 +152,21 @@ static int __init ms02nv_init_one(ulong addr)
}
ret = -ENOMEM;
- mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
+ mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
if (!mtd)
goto err_out_mod_res_rel;
- memset(mtd, 0, sizeof(*mtd));
- mp = kmalloc(sizeof(*mp), GFP_KERNEL);
+ mp = kzalloc(sizeof(*mp), GFP_KERNEL);
if (!mp)
goto err_out_mtd;
- memset(mp, 0, sizeof(*mp));
mtd->priv = mp;
mp->resource.module = mod_res;
/* Firmware's diagnostic NVRAM area. */
- diag_res = kmalloc(sizeof(*diag_res), GFP_KERNEL);
+ diag_res = kzalloc(sizeof(*diag_res), GFP_KERNEL);
if (!diag_res)
goto err_out_mp;
- memset(diag_res, 0, sizeof(*diag_res));
diag_res->name = ms02nv_res_diag_ram;
diag_res->start = addr;
diag_res->end = addr + MS02NV_RAM - 1;
@@ -180,11 +176,10 @@ static int __init ms02nv_init_one(ulong addr)
mp->resource.diag_ram = diag_res;
/* User-available general-purpose NVRAM area. */
- user_res = kmalloc(sizeof(*user_res), GFP_KERNEL);
+ user_res = kzalloc(sizeof(*user_res), GFP_KERNEL);
if (!user_res)
goto err_out_diag_res;
- memset(user_res, 0, sizeof(*user_res));
user_res->name = ms02nv_res_user_ram;
user_res->start = addr + MS02NV_RAM;
user_res->end = addr + size - 1;
@@ -194,11 +189,10 @@ static int __init ms02nv_init_one(ulong addr)
mp->resource.user_ram = user_res;
/* Control and status register. */
- csr_res = kmalloc(sizeof(*csr_res), GFP_KERNEL);
+ csr_res = kzalloc(sizeof(*csr_res), GFP_KERNEL);
if (!csr_res)
goto err_out_user_res;
- memset(csr_res, 0, sizeof(*csr_res));
csr_res->name = ms02nv_res_csr;
csr_res->start = addr + MS02NV_CSR;
csr_res->end = addr + MS02NV_CSR + 3;

drivers/mtd/devices/mtd_dataflash.c

View file
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
index 910e406..a987e91 100644
--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
@@ -480,7 +480,7 @@ add_dataflash(struct spi_device *spi, char *name,
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;

drivers/mtd/devices/phram.c

View file
diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
index 6c7337f..56cc1ca 100644
--- a/drivers/mtd/devices/phram.c
+++ b/drivers/mtd/devices/phram.c
@@ -126,12 +126,10 @@ static int register_device(char *name, unsigned long start, unsigned long len)
struct phram_mtd_list *new;
int ret = -ENOMEM;
- new = kmalloc(sizeof(*new), GFP_KERNEL);
+ new = kzalloc(sizeof(*new), GFP_KERNEL);
if (!new)
goto out0;
- memset(new, 0, sizeof(*new));
-
ret = -EIO;
new->mtd.priv = ioremap(start, len);
if (!new->mtd.priv) {

drivers/mtd/devices/slram.c

View file
diff --git a/drivers/mtd/devices/slram.c b/drivers/mtd/devices/slram.c
index 542a0c0..5f49248 100644
--- a/drivers/mtd/devices/slram.c
+++ b/drivers/mtd/devices/slram.c
@@ -168,19 +168,16 @@ static int register_device(char *name, unsigned long start, unsigned long length
E("slram: Cannot allocate new MTD device.\n");
return(-ENOMEM);
}
- (*curmtd)->mtdinfo = kmalloc(sizeof(struct mtd_info), GFP_KERNEL);
+ (*curmtd)->mtdinfo = kzalloc(sizeof(struct mtd_info), GFP_KERNEL);
(*curmtd)->next = NULL;
if ((*curmtd)->mtdinfo) {
- memset((char *)(*curmtd)->mtdinfo, 0, sizeof(struct mtd_info));
(*curmtd)->mtdinfo->priv =
- kmalloc(sizeof(slram_priv_t), GFP_KERNEL);
+ kzalloc(sizeof(slram_priv_t), GFP_KERNEL);
if (!(*curmtd)->mtdinfo->priv) {
kfree((*curmtd)->mtdinfo);
(*curmtd)->mtdinfo = NULL;
- } else {
- memset((*curmtd)->mtdinfo->priv,0,sizeof(slram_priv_t));
}
}

drivers/mtd/ftl.c

View file
diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
index 8a878b3..24235d4 100644
--- a/drivers/mtd/ftl.c
+++ b/drivers/mtd/ftl.c

This diff is incomplete. Download the complete patch.

drivers/mtd/inftlcore.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/amd76xrom.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/bast-flash.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/ceiva.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/ck804xrom.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/cstm_mips_ixx.c

View before deletion

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/esb2rom.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/integrator-flash.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/nettel.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/omap_nor.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/pcmciamtd.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/physmap.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/physmap_of.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/plat-ram.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/sa1100-flash.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/tqm834x.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/maps/tqm8xxl.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/mtd_blkdevs.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/mtdblock.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/mtdblock_ro.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/mtdchar.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/mtdconcat.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/mtdcore.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/mtdpart.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/at91_nand.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/cafe.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/cafe_ecc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/cs553x_nand.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/diskonchip.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/nand_base.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/nand_bbt.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/nand_ecc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/nandsim.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/ndfc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/rtc_from4.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nand/s3c2410.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/nftlcore.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/onenand/generic.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/onenand/onenand_base.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/onenand/onenand_bbt.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/redboot.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/rfd_ftl.c

View file

This diff is incomplete. Download the complete patch.

drivers/mtd/ssfdc.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs/jffs_fm.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/debug.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/debug.h

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/fs.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/gc.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/nodelist.h

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/readinode.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/scan.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/summary.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/super.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/symlink.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/wbuf.c

View file

This diff is incomplete. Download the complete patch.

fs/jffs2/xattr.c

View file

This diff is incomplete. Download the complete patch.

include/linux/mtd/blktrans.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mtd/mtd.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mtd/nand.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mtd/onenand.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mtd/onenand_regs.h

View file

This diff is incomplete. Download the complete patch.