patch for unlocking writeable partitions (against infradead cvs)
Christopher Hoover
ch at friction.hpl.hp.com
Thu Feb 14 14:36:33 EST 2002
Index: drivers/mtd/mtdpart.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/mtdpart.c,v
retrieving revision 1.25
diff -a -u -r1.25 mtdpart.c
--- drivers/mtd/mtdpart.c 2001/11/27 14:55:11 1.25
+++ drivers/mtd/mtdpart.c 2002/02/14 02:04:03
@@ -291,6 +291,16 @@
parts[i].name);
}
+ if ((slave->mtd.flags & MTD_WRITEABLE) &&
+ (slave->mtd.unlock)) {
+ int rv;
+ printk(KERN_DEBUG "mtd: unlocking partition \"%s\"\n",
+ parts[i].name);
+ rv = part_unlock(&slave->mtd, 0, slave->mtd.size);
+ if (rv < 0)
+ printk(KERN_ERR "mtd: failed to unlock partition \"%s\": %d\n", parts[i].name, rv);
+ }
+
/* register our partition */
add_mtd_device(&slave->mtd);
}
More information about the linux-mtd
mailing list