diff options
Diffstat (limited to 'drivers/mtd/mtdcore.c')
-rw-r--r-- | drivers/mtd/mtdcore.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 168d3ba063c3..c4d26de74349 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c | |||
@@ -57,6 +57,16 @@ int add_mtd_device(struct mtd_info *mtd) | |||
57 | mtd->index = i; | 57 | mtd->index = i; |
58 | mtd->usecount = 0; | 58 | mtd->usecount = 0; |
59 | 59 | ||
60 | /* Some chips always power up locked. Unlock them now */ | ||
61 | if ((mtd->flags & MTD_WRITEABLE) | ||
62 | && (mtd->flags & MTD_STUPID_LOCK) && mtd->unlock) { | ||
63 | if (mtd->unlock(mtd, 0, mtd->size)) | ||
64 | printk(KERN_WARNING | ||
65 | "%s: unlock failed, " | ||
66 | "writes may not work\n", | ||
67 | mtd->name); | ||
68 | } | ||
69 | |||
60 | DEBUG(0, "mtd: Giving out device %d to %s\n",i, mtd->name); | 70 | DEBUG(0, "mtd: Giving out device %d to %s\n",i, mtd->name); |
61 | /* No need to get a refcount on the module containing | 71 | /* No need to get a refcount on the module containing |
62 | the notifier, since we hold the mtd_table_mutex */ | 72 | the notifier, since we hold the mtd_table_mutex */ |