Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63fa37f0 authored by Shreeya Patel's avatar Shreeya Patel Committed by Boris Brezillon
Browse files

mtd: rawnand: Replace printk() with appropriate pr_*() macro



Using pr_<loglevel>() is more concise than printk(KERN_<LOGLEVEL>).
Replace printks having a log level with the appropriate pr_*() macros.
Define pr_fmt() and remove other additional macros from the replaced
printks.

Signed-off-by: default avatarShreeya Patel <shreeya.patel23498@gmail.com>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
parent 26777d37
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -186,7 +186,7 @@ static int ams_delta_init(struct platform_device *pdev)
	/* Allocate memory for MTD device structure and private data */
	/* Allocate memory for MTD device structure and private data */
	this = kzalloc(sizeof(struct nand_chip), GFP_KERNEL);
	this = kzalloc(sizeof(struct nand_chip), GFP_KERNEL);
	if (!this) {
	if (!this) {
		printk (KERN_WARNING "Unable to allocate E3 NAND MTD device structure.\n");
		pr_warn("Unable to allocate E3 NAND MTD device structure.\n");
		err = -ENOMEM;
		err = -ENOMEM;
		goto out;
		goto out;
	}
	}
@@ -220,7 +220,7 @@ static int ams_delta_init(struct platform_device *pdev)
		this->dev_ready = ams_delta_nand_ready;
		this->dev_ready = ams_delta_nand_ready;
	} else {
	} else {
		this->dev_ready = NULL;
		this->dev_ready = NULL;
		printk(KERN_NOTICE "Couldn't request gpio for Delta NAND ready.\n");
		pr_notice("Couldn't request gpio for Delta NAND ready.\n");
	}
	}
	/* 25 us command delay time */
	/* 25 us command delay time */
	this->chip_delay = 30;
	this->chip_delay = 30;
+2 −2
Original line number Original line Diff line number Diff line
@@ -751,7 +751,7 @@ static int cafe_nand_probe(struct pci_dev *pdev,
		cafe->nand.bbt_td = &cafe_bbt_main_descr_512;
		cafe->nand.bbt_td = &cafe_bbt_main_descr_512;
		cafe->nand.bbt_md = &cafe_bbt_mirror_descr_512;
		cafe->nand.bbt_md = &cafe_bbt_mirror_descr_512;
	} else {
	} else {
		printk(KERN_WARNING "Unexpected NAND flash writesize %d. Aborting\n",
		pr_warn("Unexpected NAND flash writesize %d. Aborting\n",
			mtd->writesize);
			mtd->writesize);
		goto out_free_dma;
		goto out_free_dma;
	}
	}
+5 −4
Original line number Original line Diff line number Diff line
@@ -187,10 +187,11 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr)
	struct nand_chip *this;
	struct nand_chip *this;
	struct mtd_info *new_mtd;
	struct mtd_info *new_mtd;


	printk(KERN_NOTICE "Probing CS553x NAND controller CS#%d at %sIO 0x%08lx\n", cs, mmio?"MM":"P", adr);
	pr_notice("Probing CS553x NAND controller CS#%d at %sIO 0x%08lx\n",
		  cs, mmio ? "MM" : "P", adr);


	if (!mmio) {
	if (!mmio) {
		printk(KERN_NOTICE "PIO mode not yet implemented for CS553X NAND controller\n");
		pr_notice("PIO mode not yet implemented for CS553X NAND controller\n");
		return -ENXIO;
		return -ENXIO;
	}
	}


@@ -209,7 +210,7 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr)
	/* map physical address */
	/* map physical address */
	this->IO_ADDR_R = this->IO_ADDR_W = ioremap(adr, 4096);
	this->IO_ADDR_R = this->IO_ADDR_W = ioremap(adr, 4096);
	if (!this->IO_ADDR_R) {
	if (!this->IO_ADDR_R) {
		printk(KERN_WARNING "ioremap cs553x NAND @0x%08lx failed\n", adr);
		pr_warn("ioremap cs553x NAND @0x%08lx failed\n", adr);
		err = -EIO;
		err = -EIO;
		goto out_mtd;
		goto out_mtd;
	}
	}
@@ -293,7 +294,7 @@ static int __init cs553x_init(void)
	/* If it doesn't have the NAND controller enabled, abort */
	/* If it doesn't have the NAND controller enabled, abort */
	rdmsrl(MSR_DIVIL_BALL_OPTS, val);
	rdmsrl(MSR_DIVIL_BALL_OPTS, val);
	if (val & PIN_OPT_IDE) {
	if (val & PIN_OPT_IDE) {
		printk(KERN_INFO "CS553x NAND controller: Flash I/O not enabled in MSR_DIVIL_BALL_OPTS.\n");
		pr_info("CS553x NAND controller: Flash I/O not enabled in MSR_DIVIL_BALL_OPTS.\n");
		return -ENXIO;
		return -ENXIO;
	}
	}


+40 −36
Original line number Original line Diff line number Diff line
@@ -409,7 +409,7 @@ static uint16_t __init doc200x_ident_chip(struct mtd_info *mtd, int nr)


		ident.dword = readl(docptr + DoC_2k_CDSN_IO);
		ident.dword = readl(docptr + DoC_2k_CDSN_IO);
		if (((ident.byte[0] << 8) | ident.byte[1]) == ret) {
		if (((ident.byte[0] << 8) | ident.byte[1]) == ret) {
			printk(KERN_INFO "DiskOnChip 2000 responds to DWORD access\n");
			pr_info("DiskOnChip 2000 responds to DWORD access\n");
			this->read_buf = &doc2000_readbuf_dword;
			this->read_buf = &doc2000_readbuf_dword;
		}
		}
	}
	}
@@ -436,7 +436,7 @@ static void __init doc2000_count_chips(struct mtd_info *mtd)
			break;
			break;
	}
	}
	doc->chips_per_floor = i;
	doc->chips_per_floor = i;
	printk(KERN_DEBUG "Detected %d chips per floor.\n", i);
	pr_debug("Detected %d chips per floor.\n", i);
}
}


static int doc200x_wait(struct mtd_info *mtd, struct nand_chip *this)
static int doc200x_wait(struct mtd_info *mtd, struct nand_chip *this)
@@ -932,14 +932,15 @@ static int doc200x_correct_data(struct mtd_info *mtd, u_char *dat,


		ret = doc_ecc_decode(rs_decoder, dat, calc_ecc);
		ret = doc_ecc_decode(rs_decoder, dat, calc_ecc);
		if (ret > 0)
		if (ret > 0)
			printk(KERN_ERR "doc200x_correct_data corrected %d errors\n", ret);
			pr_err("doc200x_correct_data corrected %d errors\n",
			       ret);
	}
	}
	if (DoC_is_MillenniumPlus(doc))
	if (DoC_is_MillenniumPlus(doc))
		WriteDOC(DOC_ECC_DIS, docptr, Mplus_ECCConf);
		WriteDOC(DOC_ECC_DIS, docptr, Mplus_ECCConf);
	else
	else
		WriteDOC(DOC_ECC_DIS, docptr, ECCConf);
		WriteDOC(DOC_ECC_DIS, docptr, ECCConf);
	if (no_ecc_failures && mtd_is_eccerr(ret)) {
	if (no_ecc_failures && mtd_is_eccerr(ret)) {
		printk(KERN_ERR "suppressing ECC failure\n");
		pr_err("suppressing ECC failure\n");
		ret = 0;
		ret = 0;
	}
	}
	return ret;
	return ret;
@@ -1012,11 +1013,11 @@ static int __init find_media_headers(struct mtd_info *mtd, u_char *buf, const ch
		if (retlen != mtd->writesize)
		if (retlen != mtd->writesize)
			continue;
			continue;
		if (ret) {
		if (ret) {
			printk(KERN_WARNING "ECC error scanning DOC at 0x%x\n", offs);
			pr_warn("ECC error scanning DOC at 0x%x\n", offs);
		}
		}
		if (memcmp(buf, id, 6))
		if (memcmp(buf, id, 6))
			continue;
			continue;
		printk(KERN_INFO "Found DiskOnChip %s Media Header at 0x%x\n", id, offs);
		pr_info("Found DiskOnChip %s Media Header at 0x%x\n", id, offs);
		if (doc->mh0_page == -1) {
		if (doc->mh0_page == -1) {
			doc->mh0_page = offs >> this->page_shift;
			doc->mh0_page = offs >> this->page_shift;
			if (!findmirror)
			if (!findmirror)
@@ -1027,7 +1028,7 @@ static int __init find_media_headers(struct mtd_info *mtd, u_char *buf, const ch
		return 2;
		return 2;
	}
	}
	if (doc->mh0_page == -1) {
	if (doc->mh0_page == -1) {
		printk(KERN_WARNING "DiskOnChip %s Media Header not found.\n", id);
		pr_warn("DiskOnChip %s Media Header not found.\n", id);
		return 0;
		return 0;
	}
	}
	/* Only one mediaheader was found.  We want buf to contain a
	/* Only one mediaheader was found.  We want buf to contain a
@@ -1036,7 +1037,7 @@ static int __init find_media_headers(struct mtd_info *mtd, u_char *buf, const ch
	ret = mtd_read(mtd, offs, mtd->writesize, &retlen, buf);
	ret = mtd_read(mtd, offs, mtd->writesize, &retlen, buf);
	if (retlen != mtd->writesize) {
	if (retlen != mtd->writesize) {
		/* Insanity.  Give up. */
		/* Insanity.  Give up. */
		printk(KERN_ERR "Read DiskOnChip Media Header once, but can't reread it???\n");
		pr_err("Read DiskOnChip Media Header once, but can't reread it???\n");
		return 0;
		return 0;
	}
	}
	return 1;
	return 1;
@@ -1066,7 +1067,7 @@ static inline int __init nftl_partscan(struct mtd_info *mtd, struct mtd_partitio
	le16_to_cpus(&mh->FirstPhysicalEUN);
	le16_to_cpus(&mh->FirstPhysicalEUN);
	le32_to_cpus(&mh->FormattedSize);
	le32_to_cpus(&mh->FormattedSize);


	printk(KERN_INFO "    DataOrgID        = %s\n"
	pr_info("    DataOrgID        = %s\n"
		"    NumEraseUnits    = %d\n"
		"    NumEraseUnits    = %d\n"
		"    FirstPhysicalEUN = %d\n"
		"    FirstPhysicalEUN = %d\n"
		"    FormattedSize    = %d\n"
		"    FormattedSize    = %d\n"
@@ -1090,7 +1091,7 @@ static inline int __init nftl_partscan(struct mtd_info *mtd, struct mtd_partitio
			maxblocks = min(32768U, (maxblocks << 1) + psize);
			maxblocks = min(32768U, (maxblocks << 1) + psize);
			mh->UnitSizeFactor--;
			mh->UnitSizeFactor--;
		}
		}
		printk(KERN_WARNING "UnitSizeFactor=0x00 detected.  Correct value is assumed to be 0x%02x.\n", mh->UnitSizeFactor);
		pr_warn("UnitSizeFactor=0x00 detected.  Correct value is assumed to be 0x%02x.\n", mh->UnitSizeFactor);
	}
	}


	/* NOTE: The lines below modify internal variables of the NAND and MTD
	/* NOTE: The lines below modify internal variables of the NAND and MTD
@@ -1101,13 +1102,13 @@ static inline int __init nftl_partscan(struct mtd_info *mtd, struct mtd_partitio
	if (mh->UnitSizeFactor != 0xff) {
	if (mh->UnitSizeFactor != 0xff) {
		this->bbt_erase_shift += (0xff - mh->UnitSizeFactor);
		this->bbt_erase_shift += (0xff - mh->UnitSizeFactor);
		mtd->erasesize <<= (0xff - mh->UnitSizeFactor);
		mtd->erasesize <<= (0xff - mh->UnitSizeFactor);
		printk(KERN_INFO "Setting virtual erase size to %d\n", mtd->erasesize);
		pr_info("Setting virtual erase size to %d\n", mtd->erasesize);
		blocks = mtd->size >> this->bbt_erase_shift;
		blocks = mtd->size >> this->bbt_erase_shift;
		maxblocks = min(32768U, mtd->erasesize - psize);
		maxblocks = min(32768U, mtd->erasesize - psize);
	}
	}


	if (blocks > maxblocks) {
	if (blocks > maxblocks) {
		printk(KERN_ERR "UnitSizeFactor of 0x%02x is inconsistent with device size.  Aborting.\n", mh->UnitSizeFactor);
		pr_err("UnitSizeFactor of 0x%02x is inconsistent with device size.  Aborting.\n", mh->UnitSizeFactor);
		goto out;
		goto out;
	}
	}


@@ -1178,7 +1179,7 @@ static inline int __init inftl_partscan(struct mtd_info *mtd, struct mtd_partiti
	le32_to_cpus(&mh->FormatFlags);
	le32_to_cpus(&mh->FormatFlags);
	le32_to_cpus(&mh->PercentUsed);
	le32_to_cpus(&mh->PercentUsed);


	printk(KERN_INFO "    bootRecordID          = %s\n"
	pr_info("    bootRecordID          = %s\n"
		"    NoOfBootImageBlocks   = %d\n"
		"    NoOfBootImageBlocks   = %d\n"
		"    NoOfBinaryPartitions  = %d\n"
		"    NoOfBinaryPartitions  = %d\n"
		"    NoOfBDTLPartitions    = %d\n"
		"    NoOfBDTLPartitions    = %d\n"
@@ -1200,13 +1201,13 @@ static inline int __init inftl_partscan(struct mtd_info *mtd, struct mtd_partiti


	blocks = mtd->size >> vshift;
	blocks = mtd->size >> vshift;
	if (blocks > 32768) {
	if (blocks > 32768) {
		printk(KERN_ERR "BlockMultiplierBits=%d is inconsistent with device size.  Aborting.\n", mh->BlockMultiplierBits);
		pr_err("BlockMultiplierBits=%d is inconsistent with device size.  Aborting.\n", mh->BlockMultiplierBits);
		goto out;
		goto out;
	}
	}


	blocks = doc->chips_per_floor << (this->chip_shift - this->phys_erase_shift);
	blocks = doc->chips_per_floor << (this->chip_shift - this->phys_erase_shift);
	if (inftl_bbt_write && (blocks > mtd->erasesize)) {
	if (inftl_bbt_write && (blocks > mtd->erasesize)) {
		printk(KERN_ERR "Writeable BBTs spanning more than one erase block are not yet supported.  FIX ME!\n");
		pr_err("Writeable BBTs spanning more than one erase block are not yet supported.  FIX ME!\n");
		goto out;
		goto out;
	}
	}


@@ -1220,7 +1221,7 @@ static inline int __init inftl_partscan(struct mtd_info *mtd, struct mtd_partiti
		le32_to_cpus(&ip->spareUnits);
		le32_to_cpus(&ip->spareUnits);
		le32_to_cpus(&ip->Reserved0);
		le32_to_cpus(&ip->Reserved0);


		printk(KERN_INFO	"    PARTITION[%d] ->\n"
		pr_info("    PARTITION[%d] ->\n"
			"        virtualUnits    = %d\n"
			"        virtualUnits    = %d\n"
			"        firstUnit       = %d\n"
			"        firstUnit       = %d\n"
			"        lastUnit        = %d\n"
			"        lastUnit        = %d\n"
@@ -1306,7 +1307,7 @@ static int __init inftl_scan_bbt(struct mtd_info *mtd)
	struct mtd_partition parts[5];
	struct mtd_partition parts[5];


	if (this->numchips > doc->chips_per_floor) {
	if (this->numchips > doc->chips_per_floor) {
		printk(KERN_ERR "Multi-floor INFTL devices not yet supported.\n");
		pr_err("Multi-floor INFTL devices not yet supported.\n");
		return -EIO;
		return -EIO;
	}
	}


@@ -1434,7 +1435,8 @@ static int __init doc_probe(unsigned long physadr)
		return -EBUSY;
		return -EBUSY;
	virtadr = ioremap(physadr, DOC_IOREMAP_LEN);
	virtadr = ioremap(physadr, DOC_IOREMAP_LEN);
	if (!virtadr) {
	if (!virtadr) {
		printk(KERN_ERR "Diskonchip ioremap failed: 0x%x bytes at 0x%lx\n", DOC_IOREMAP_LEN, physadr);
		pr_err("Diskonchip ioremap failed: 0x%x bytes at 0x%lx\n",
		       DOC_IOREMAP_LEN, physadr);
		ret = -EIO;
		ret = -EIO;
		goto error_ioremap;
		goto error_ioremap;
	}
	}
@@ -1493,7 +1495,7 @@ static int __init doc_probe(unsigned long physadr)
			reg = DoC_Mplus_Toggle;
			reg = DoC_Mplus_Toggle;
			break;
			break;
		case DOC_ChipID_DocMilPlus32:
		case DOC_ChipID_DocMilPlus32:
			printk(KERN_ERR "DiskOnChip Millennium Plus 32MB is not supported, ignoring.\n");
			pr_err("DiskOnChip Millennium Plus 32MB is not supported, ignoring.\n");
		default:
		default:
			ret = -ENODEV;
			ret = -ENODEV;
			goto notfound;
			goto notfound;
@@ -1509,7 +1511,7 @@ static int __init doc_probe(unsigned long physadr)
	tmpb = ReadDOC_(virtadr, reg) & DOC_TOGGLE_BIT;
	tmpb = ReadDOC_(virtadr, reg) & DOC_TOGGLE_BIT;
	tmpc = ReadDOC_(virtadr, reg) & DOC_TOGGLE_BIT;
	tmpc = ReadDOC_(virtadr, reg) & DOC_TOGGLE_BIT;
	if ((tmp == tmpb) || (tmp != tmpc)) {
	if ((tmp == tmpb) || (tmp != tmpc)) {
		printk(KERN_WARNING "Possible DiskOnChip at 0x%lx failed TOGGLE test, dropping.\n", physadr);
		pr_warn("Possible DiskOnChip at 0x%lx failed TOGGLE test, dropping.\n", physadr);
		ret = -ENODEV;
		ret = -ENODEV;
		goto notfound;
		goto notfound;
	}
	}
@@ -1543,12 +1545,13 @@ static int __init doc_probe(unsigned long physadr)
		}
		}
		newval = ~newval;
		newval = ~newval;
		if (oldval == newval) {
		if (oldval == newval) {
			printk(KERN_DEBUG "Found alias of DOC at 0x%lx to 0x%lx\n", doc->physadr, physadr);
			pr_debug("Found alias of DOC at 0x%lx to 0x%lx\n",
				 doc->physadr, physadr);
			goto notfound;
			goto notfound;
		}
		}
	}
	}


	printk(KERN_NOTICE "DiskOnChip found at 0x%lx\n", physadr);
	pr_notice("DiskOnChip found at 0x%lx\n", physadr);


	len = sizeof(struct nand_chip) + sizeof(struct doc_priv) +
	len = sizeof(struct nand_chip) + sizeof(struct doc_priv) +
	      (2 * sizeof(struct nand_bbt_descr));
	      (2 * sizeof(struct nand_bbt_descr));
@@ -1663,12 +1666,13 @@ static int __init init_nanddoc(void)
	 */
	 */
	rs_decoder = init_rs(10, 0x409, FCR, 1, NROOTS);
	rs_decoder = init_rs(10, 0x409, FCR, 1, NROOTS);
	if (!rs_decoder) {
	if (!rs_decoder) {
		printk(KERN_ERR "DiskOnChip: Could not create a RS decoder\n");
		pr_err("DiskOnChip: Could not create a RS decoder\n");
		return -ENOMEM;
		return -ENOMEM;
	}
	}


	if (doc_config_location) {
	if (doc_config_location) {
		printk(KERN_INFO "Using configured DiskOnChip probe address 0x%lx\n", doc_config_location);
		pr_info("Using configured DiskOnChip probe address 0x%lx\n",
			doc_config_location);
		ret = doc_probe(doc_config_location);
		ret = doc_probe(doc_config_location);
		if (ret < 0)
		if (ret < 0)
			goto outerr;
			goto outerr;
@@ -1680,7 +1684,7 @@ static int __init init_nanddoc(void)
	/* No banner message any more. Print a message if no DiskOnChip
	/* No banner message any more. Print a message if no DiskOnChip
	   found, so the user knows we at least tried. */
	   found, so the user knows we at least tried. */
	if (!doclist) {
	if (!doclist) {
		printk(KERN_INFO "No valid DiskOnChip devices found\n");
		pr_info("No valid DiskOnChip devices found\n");
		ret = -ENODEV;
		ret = -ENODEV;
		goto outerr;
		goto outerr;
	}
	}
+2 −2
Original line number Original line Diff line number Diff line
@@ -929,7 +929,7 @@ static int fsl_elbc_nand_probe(struct platform_device *pdev)
	mtd_device_parse_register(mtd, part_probe_types, NULL,
	mtd_device_parse_register(mtd, part_probe_types, NULL,
				  NULL, 0);
				  NULL, 0);


	printk(KERN_INFO "eLBC NAND device at 0x%llx, bank %d\n",
	pr_info("eLBC NAND device at 0x%llx, bank %d\n",
		(unsigned long long)res.start, priv->bank);
		(unsigned long long)res.start, priv->bank);
	return 0;
	return 0;


Loading