diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 18:20:31 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 18:20:31 (GMT) |
commit | a8e98d6d51a3eb7bb061b1625193a129c8bd094f (patch) | |
tree | 0fa58b6e11e37023b024e55b8f0e7e01438706d4 /drivers/mtd/mtdpart.c | |
parent | f0f1b3364ae7f48084bdf2837fb979ff59622523 (diff) | |
parent | f9f7dd222364a6428d2ad99a515935dd1dd89d18 (diff) | |
download | linux-fsl-qoriq-a8e98d6d51a3eb7bb061b1625193a129c8bd094f.tar.xz |
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (120 commits)
[MTD] Fix mtdoops.c compilation
[MTD] [NOR] fix startup lock when using multiple nor flash chips
[MTD] [DOC200x] eccbuf is statically defined and always evaluate to true
[MTD] Fix maps/physmap.c compilation with CONFIG_PM
[MTD] onenand: Add panic_write function to the onenand driver
[MTD] mtdoops: Use the panic_write function when present
[MTD] Add mtd panic_write function pointer
[MTD] [NAND] Freescale enhanced Local Bus Controller FCM NAND support.
[MTD] physmap.c: Add support for multiple resources
[MTD] [NAND] Fix misparenthesization introduced by commit 78b65179...
[MTD] [NAND] Fix Blackfin NFC ECC calculating bug with page size 512 bytes
[MTD] [NAND] Remove wrong operation in PM function of the BF54x NFC driver
[MTD] [NAND] Remove unused variable in plat_nand_remove
[MTD] Unlocking all Intel flash that is locked on power up.
[MTD] [NAND] at91_nand: Make mtdparts option can override board info
[MTD] mtdoops: Various minor cleanups
[MTD] mtdoops: Ensure sequential write to the buffer
[MTD] mtdoops: Perform write operations in a workqueue
[MTD] mtdoops: Add further error return code checking
[MTD] [NOR] Test devtype, not definition in flash_probe(), drivers/mtd/devices/lart.c
...
Diffstat (limited to 'drivers/mtd/mtdpart.c')
-rw-r--r-- | drivers/mtd/mtdpart.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 6174a97..c66902d 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c @@ -151,6 +151,20 @@ static int part_write (struct mtd_info *mtd, loff_t to, size_t len, len, retlen, buf); } +static int part_panic_write (struct mtd_info *mtd, loff_t to, size_t len, + size_t *retlen, const u_char *buf) +{ + struct mtd_part *part = PART(mtd); + if (!(mtd->flags & MTD_WRITEABLE)) + return -EROFS; + if (to >= mtd->size) + len = 0; + else if (to + len > mtd->size) + len = mtd->size - to; + return part->master->panic_write (part->master, to + part->offset, + len, retlen, buf); +} + static int part_write_oob(struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops) { @@ -352,6 +366,9 @@ int add_mtd_partitions(struct mtd_info *master, slave->mtd.read = part_read; slave->mtd.write = part_write; + if (master->panic_write) + slave->mtd.panic_write = part_panic_write; + if(master->point && master->unpoint){ slave->mtd.point = part_point; slave->mtd.unpoint = part_unpoint; |