aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdpart.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/mtdpart.c')
-rw-r--r--drivers/mtd/mtdpart.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index b8043a9ba32d..4c539ded0b70 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -264,6 +264,14 @@ static int part_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
264 return part->master->unlock(part->master, ofs + part->offset, len); 264 return part->master->unlock(part->master, ofs + part->offset, len);
265} 265}
266 266
267static int part_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len)
268{
269 struct mtd_part *part = PART(mtd);
270 if ((len + ofs) > mtd->size)
271 return -EINVAL;
272 return part->master->is_locked(part->master, ofs + part->offset, len);
273}
274
267static void part_sync(struct mtd_info *mtd) 275static void part_sync(struct mtd_info *mtd)
268{ 276{
269 struct mtd_part *part = PART(mtd); 277 struct mtd_part *part = PART(mtd);
@@ -402,6 +410,8 @@ static struct mtd_part *add_one_partition(struct mtd_info *master,
402 slave->mtd.lock = part_lock; 410 slave->mtd.lock = part_lock;
403 if (master->unlock) 411 if (master->unlock)
404 slave->mtd.unlock = part_unlock; 412 slave->mtd.unlock = part_unlock;
413 if (master->is_locked)
414 slave->mtd.is_locked = part_is_locked;
405 if (master->block_isbad) 415 if (master->block_isbad)
406 slave->mtd.block_isbad = part_block_isbad; 416 slave->mtd.block_isbad = part_block_isbad;
407 if (master->block_markbad) 417 if (master->block_markbad)