static int warncount = 5;
if (warncount) {
- printk(KERN_WARNING "INFTL: block read at 0x%x "
+ pr_warn("INFTL: block read at 0x%x "
"of mtd%d failed: %d\n",
block * inftl->EraseSize,
inftl->mbd.mtd->index, ret);
if (!--warncount)
- printk(KERN_WARNING "INFTL: further "
+ pr_warn("INFTL: further "
"failures for this block will "
"not be printed\n");
}
block * inftl->EraseSize + SECTORSIZE + 8,
8, &retlen,(char *)&h1);
if (ret < 0) {
- printk(KERN_WARNING "INFTL: ANAND header found at "
+ pr_warn("INFTL: ANAND header found at "
"0x%x in mtd%d, but OOB data read failed "
"(err %d)\n", block * inftl->EraseSize,
inftl->mbd.mtd->index, ret);
mtd_read(mtd, block * inftl->EraseSize + 4096, SECTORSIZE,
&retlen, buf);
if (retlen != SECTORSIZE) {
- printk(KERN_WARNING "INFTL: Unable to read spare "
+ pr_warn("INFTL: Unable to read spare "
"Media Header\n");
return -1;
}
/* Check if this one is the same as the first one we found. */
if (memcmp(mh, buf, sizeof(struct INFTLMediaHeader))) {
- printk(KERN_WARNING "INFTL: Primary and spare Media "
+ pr_warn("INFTL: Primary and spare Media "
"Headers disagree.\n");
return -1;
}
mh->OsakVersion, mh->PercentUsed);
if (mh->NoOfBDTLPartitions == 0) {
- printk(KERN_WARNING "INFTL: Media Header sanity check "
+ pr_warn("INFTL: Media Header sanity check "
"failed: NoOfBDTLPartitions (%d) == 0, "
"must be at least 1\n", mh->NoOfBDTLPartitions);
return -1;
}
if ((mh->NoOfBDTLPartitions + mh->NoOfBinaryPartitions) > 4) {
- printk(KERN_WARNING "INFTL: Media Header sanity check "
+ pr_warn("INFTL: Media Header sanity check "
"failed: Total Partitions (%d) > 4, "
"BDTL=%d Binary=%d\n", mh->NoOfBDTLPartitions +
mh->NoOfBinaryPartitions,
}
if (mh->BlockMultiplierBits > 1) {
- printk(KERN_WARNING "INFTL: sorry, we don't support "
+ pr_warn("INFTL: sorry, we don't support "
"UnitSizeFactor 0x%02x\n",
mh->BlockMultiplierBits);
return -1;
} else if (mh->BlockMultiplierBits == 1) {
- printk(KERN_WARNING "INFTL: support for INFTL with "
+ pr_warn("INFTL: support for INFTL with "
"UnitSizeFactor 0x%02x is experimental\n",
mh->BlockMultiplierBits);
inftl->EraseSize = inftl->mbd.mtd->erasesize <<
mtd_erase(mtd, instr);
}
if ((ip->lastUnit - ip->firstUnit + 1) < ip->virtualUnits) {
- printk(KERN_WARNING "INFTL: Media Header "
+ pr_warn("INFTL: Media Header "
"Partition %d sanity check failed\n"
" firstUnit %d : lastUnit %d > "
"virtualUnits %d\n", i, ip->lastUnit,
return -1;
}
if (ip->Reserved1 != 0) {
- printk(KERN_WARNING "INFTL: Media Header "
+ pr_warn("INFTL: Media Header "
"Partition %d sanity check failed: "
"Reserved1 %d != 0\n",
i, ip->Reserved1);
}
if (i >= 4) {
- printk(KERN_WARNING "INFTL: Media Header Partition "
+ pr_warn("INFTL: Media Header Partition "
"sanity check failed:\n No partition "
"marked as Disk Partition\n");
return -1;
inftl->numvunits = ip->virtualUnits;
if (inftl->numvunits > (inftl->nb_blocks -
inftl->nb_boot_blocks - 2)) {
- printk(KERN_WARNING "INFTL: Media Header sanity check "
+ pr_warn("INFTL: Media Header sanity check "
"failed:\n numvunits (%d) > nb_blocks "
"(%d) - nb_boot_blocks(%d) - 2\n",
inftl->numvunits, inftl->nb_blocks,
ret = mtd_erase(inftl->mbd.mtd, instr);
if (ret) {
- printk(KERN_WARNING "INFTL: error while formatting block %d\n",
+ pr_warn("INFTL: error while formatting block %d\n",
block);
goto fail;
}
{
unsigned int block = first_block, block1;
- printk(KERN_WARNING "INFTL: formatting chain at block %d\n",
+ pr_warn("INFTL: formatting chain at block %d\n",
first_block);
for (;;) {
block1 = inftl->PUtable[block];
- printk(KERN_WARNING "INFTL: formatting block %d\n", block);
+ pr_warn("INFTL: formatting block %d\n", block);
if (INFTL_formatblock(inftl, block) < 0) {
/*
* Cannot format !!!! Mark it as Bad Unit,
/* Search for INFTL MediaHeader and Spare INFTL Media Header */
if (find_boot_record(s) < 0) {
- printk(KERN_WARNING "INFTL: could not find valid boot record?\n");
+ pr_warn("INFTL: could not find valid boot record?\n");
return -ENXIO;
}
/* Check for invalid block */
if (erase_mark != ERASE_MARK) {
- printk(KERN_WARNING "INFTL: corrupt block %d "
+ pr_warn("INFTL: corrupt block %d "
"in chain %d, chain length %d, erase "
"mark 0x%x?\n", block, first_block,
chain_length, erase_mark);
((prev_block >= s->nb_blocks) &&
(prev_block != BLOCK_NIL))) {
if (chain_length > 0) {
- printk(KERN_WARNING "INFTL: corrupt "
+ pr_warn("INFTL: corrupt "
"block %d in chain %d?\n",
block, first_block);
do_format_chain++;
/* Validate next block before following it... */
if (block > s->lastEUN) {
- printk(KERN_WARNING "INFTL: invalid previous "
+ pr_warn("INFTL: invalid previous "
"block %d in chain %d?\n", block,
first_block);
do_format_chain++;
if (s->PUtable[block] == BLOCK_NIL)
break;
if (s->PUtable[block] > s->lastEUN) {
- printk(KERN_WARNING "INFTL: invalid prev %d, "
+ pr_warn("INFTL: invalid prev %d, "
"in virtual chain %d\n",
s->PUtable[block], logical_block);
s->PUtable[block] = BLOCK_NIL;
pr_debug("INFTL: pass 3, format unused blocks\n");
for (block = s->firstEUN; block <= s->lastEUN; block++) {
if (s->PUtable[block] == BLOCK_NOTEXPLORED) {
- printk("INFTL: unreferenced block %d, formatting it\n",
+ pr_warn("INFTL: unreferenced block %d, formatting it\n",
block);
if (INFTL_formatblock(s, block) < 0)
s->PUtable[block] = BLOCK_RESERVED;