aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd/mtdcore.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-09-22 12:49:18 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-22 12:49:18 -0700
commita48178a2fa17beee17d7e6aeaa6ed2db5813552d (patch)
tree74579777d047478b3d62fcc3349a903b53515770 /drivers/mtd/mtdcore.c
parent14d1adfc59ba66932ef167fdff62983e7c2b0197 (diff)
parent734a56285dbeedc6cc10aef6f700eeab7c65ea9f (diff)
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: Remove accidentally-added include/linux/utsrelease.h Revert "[MTD] blkdev helper code: fix printk format warning" [MTD] Add SSFDC (SmartMedia) read-only translation layer [MTD] pmc551 pci cleanup [MTD] pmc551 use kzalloc [MTD] pmc551 whitespace cleanup [MTD] Remove iq80310 map driver [MTD NAND] Fix in typo ndfc.c causing wrong ECC layout [MTD] physmap: add power management support ioremap balanced with iounmap for drivers/mtd subsystem [MTD] Switch to pci_get_device and do ref counting [MTD] blkdev helper code: fix printk format warning [MTD] Fix ixp4xx partition parsing. [JFFS2] Remove unneeded ifdefs from jffs2_fs_i.h [MTD NAND] Remove old code in au1550nd.c [MTD] Unlock NOR flash automatically where necessary
Diffstat (limited to 'drivers/mtd/mtdcore.c')
-rw-r--r--drivers/mtd/mtdcore.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 168d3ba063c..c4d26de7434 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -57,6 +57,16 @@ int add_mtd_device(struct mtd_info *mtd)
mtd->index = i;
mtd->usecount = 0;
+ /* Some chips always power up locked. Unlock them now */
+ if ((mtd->flags & MTD_WRITEABLE)
+ && (mtd->flags & MTD_STUPID_LOCK) && mtd->unlock) {
+ if (mtd->unlock(mtd, 0, mtd->size))
+ printk(KERN_WARNING
+ "%s: unlock failed, "
+ "writes may not work\n",
+ mtd->name);
+ }
+
DEBUG(0, "mtd: Giving out device %d to %s\n",i, mtd->name);
/* No need to get a refcount on the module containing
the notifier, since we hold the mtd_table_mutex */