Skip to content

Commit 5942ddb

Browse files
dedekindDavid Woodhouse
authored andcommitted
mtd: introduce mtd_block_markbad interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent 7086c19 commit 5942ddb

12 files changed

Lines changed: 17 additions & 14 deletions

File tree

‎drivers/mtd/inftlmount.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ int INFTL_formatblock(struct INFTLrecord *inftl, int block)
424424
fail:
425425
/* could not format, update the bad block table (caller is responsible
426426
for setting the PUtable to BLOCK_RESERVED on failure) */
427-
inftl->mbd.mtd->block_markbad(inftl->mbd.mtd, instr->addr);
427+
mtd_block_markbad(inftl->mbd.mtd, instr->addr);
428428
return -1;
429429
}
430430

‎drivers/mtd/mtdchar.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg)
899899
if (!mtd->block_markbad)
900900
ret = -EOPNOTSUPP;
901901
else
902-
return mtd->block_markbad(mtd, offs);
902+
return mtd_block_markbad(mtd, offs);
903903
break;
904904
}
905905

‎drivers/mtd/mtdconcat.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ static int concat_block_markbad(struct mtd_info *mtd, loff_t ofs)
693693
continue;
694694
}
695695

696-
err = subdev->block_markbad(subdev, ofs);
696+
err = mtd_block_markbad(subdev, ofs);
697697
if (!err)
698698
mtd->ecc_stats.badblocks++;
699699
break;

‎drivers/mtd/mtdoops.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ static void mtdoops_workfunc_erase(struct work_struct *work)
200200
}
201201

202202
if (mtd->block_markbad && ret == -EIO) {
203-
ret = mtd->block_markbad(mtd, cxt->nextpage * record_size);
203+
ret = mtd_block_markbad(mtd, cxt->nextpage * record_size);
204204
if (ret < 0) {
205205
printk(KERN_ERR "mtdoops: block_markbad failed, aborting\n");
206206
return;

‎drivers/mtd/mtdpart.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ static int part_block_markbad(struct mtd_info *mtd, loff_t ofs)
335335
if (ofs >= mtd->size)
336336
return -EINVAL;
337337
ofs += part->offset;
338-
res = part->master->block_markbad(part->master, ofs);
338+
res = mtd_block_markbad(part->master, ofs);
339339
if (!res)
340340
mtd->ecc_stats.badblocks++;
341341
return res;

‎drivers/mtd/mtdswap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ static int mtdswap_handle_badblock(struct mtdswap_dev *d, struct swap_eb *eb)
279279

280280
offset = mtdswap_eb_offset(d, eb);
281281
dev_warn(d->dev, "Marking bad block at %08llx\n", offset);
282-
ret = d->mtd->block_markbad(d->mtd, offset);
282+
ret = mtd_block_markbad(d->mtd, offset);
283283

284284
if (ret) {
285285
dev_warn(d->dev, "Mark block bad failed for block at %08llx "

‎drivers/mtd/nand/nandsim.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ static int parse_badblocks(struct nandsim *ns, struct mtd_info *mtd)
737737
return -EINVAL;
738738
}
739739
offset = erase_block_no * ns->geom.secsz;
740-
if (mtd->block_markbad(mtd, offset)) {
740+
if (mtd_block_markbad(mtd, offset)) {
741741
NS_ERR("invalid badblocks.\n");
742742
return -EINVAL;
743743
}

‎drivers/mtd/nftlmount.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ int NFTL_formatblock(struct NFTLrecord *nftl, int block)
356356
fail:
357357
/* could not format, update the bad block table (caller is responsible
358358
for setting the ReplUnitTable to BLOCK_RESERVED on failure) */
359-
nftl->mbd.mtd->block_markbad(nftl->mbd.mtd, instr->addr);
359+
mtd_block_markbad(nftl->mbd.mtd, instr->addr);
360360
return -1;
361361
}
362362

‎drivers/mtd/onenand/onenand_base.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2645,7 +2645,7 @@ static int onenand_block_markbad(struct mtd_info *mtd, loff_t ofs)
26452645
}
26462646

26472647
onenand_get_device(mtd, FL_WRITING);
2648-
ret = this->block_markbad(mtd, ofs);
2648+
ret = mtd_block_markbad(mtd, ofs);
26492649
onenand_release_device(mtd);
26502650
return ret;
26512651
}

‎drivers/mtd/ubi/io.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ int ubi_io_mark_bad(const struct ubi_device *ubi, int pnum)
669669
if (!ubi->bad_allowed)
670670
return 0;
671671

672-
err = mtd->block_markbad(mtd, (loff_t)pnum * ubi->peb_size);
672+
err = mtd_block_markbad(mtd, (loff_t)pnum * ubi->peb_size);
673673
if (err)
674674
ubi_err("cannot mark PEB %d bad, error %d", pnum, err);
675675
return err;

0 commit comments

Comments
 (0)