Commit 9a4d4d69 authored by Brian Norris's avatar Brian Norris Committed by Artem Bityutskiy

mtd: nand: convert printk() to pr_*()

Instead of directly calling printk, it's simpler to use the built-in
pr_* functions. This shortens code and allows easy customization through
the definition of a pr_fmt() macro (not used currently). Ideally, we
could implement much of this with dev_* functions, but the MTD subsystem
does not necessarily register all its master `mtd_info.dev` device, so
we cannot use dev_* consistently. See:
http://lists.infradead.org/pipermail/linux-mtd/2011-July/036950.htmlSigned-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@intel.com>
parent a0f5080e
...@@ -2179,7 +2179,7 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to, ...@@ -2179,7 +2179,7 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
/* Reject writes, which are not page aligned */ /* Reject writes, which are not page aligned */
if (NOTALIGNED(to) || NOTALIGNED(ops->len)) { if (NOTALIGNED(to) || NOTALIGNED(ops->len)) {
printk(KERN_NOTICE "%s: Attempt to write not " pr_notice("%s: Attempt to write not "
"page aligned data\n", __func__); "page aligned data\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -2570,7 +2570,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, ...@@ -2570,7 +2570,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
/* Heck if we have a bad block, we do not erase bad blocks! */ /* Heck if we have a bad block, we do not erase bad blocks! */
if (nand_block_checkbad(mtd, ((loff_t) page) << if (nand_block_checkbad(mtd, ((loff_t) page) <<
chip->page_shift, 0, allowbbt)) { chip->page_shift, 0, allowbbt)) {
printk(KERN_WARNING "%s: attempt to erase a bad block " pr_warn("%s: attempt to erase a bad block "
"at page 0x%08x\n", __func__, page); "at page 0x%08x\n", __func__, page);
instr->state = MTD_ERASE_FAILED; instr->state = MTD_ERASE_FAILED;
goto erase_exit; goto erase_exit;
...@@ -2744,7 +2744,7 @@ static void nand_resume(struct mtd_info *mtd) ...@@ -2744,7 +2744,7 @@ static void nand_resume(struct mtd_info *mtd)
if (chip->state == FL_PM_SUSPENDED) if (chip->state == FL_PM_SUSPENDED)
nand_release_device(mtd); nand_release_device(mtd);
else else
printk(KERN_ERR "%s called for a chip which is not " pr_err("%s called for a chip which is not "
"in suspended state\n", __func__); "in suspended state\n", __func__);
} }
...@@ -2836,13 +2836,13 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip, ...@@ -2836,13 +2836,13 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
chip->read_byte(mtd) != 'F' || chip->read_byte(mtd) != 'I') chip->read_byte(mtd) != 'F' || chip->read_byte(mtd) != 'I')
return 0; return 0;
printk(KERN_INFO "ONFI flash detected\n"); pr_info("ONFI flash detected\n");
chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1); chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1);
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
chip->read_buf(mtd, (uint8_t *)p, sizeof(*p)); chip->read_buf(mtd, (uint8_t *)p, sizeof(*p));
if (onfi_crc16(ONFI_CRC_BASE, (uint8_t *)p, 254) == if (onfi_crc16(ONFI_CRC_BASE, (uint8_t *)p, 254) ==
le16_to_cpu(p->crc)) { le16_to_cpu(p->crc)) {
printk(KERN_INFO "ONFI param page %d valid\n", i); pr_info("ONFI param page %d valid\n", i);
break; break;
} }
} }
...@@ -2866,7 +2866,7 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip, ...@@ -2866,7 +2866,7 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
chip->onfi_version = 0; chip->onfi_version = 0;
if (!chip->onfi_version) { if (!chip->onfi_version) {
printk(KERN_INFO "%s: unsupported ONFI version: %d\n", pr_info("%s: unsupported ONFI version: %d\n",
__func__, val); __func__, val);
return 0; return 0;
} }
...@@ -2932,7 +2932,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd, ...@@ -2932,7 +2932,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
id_data[i] = chip->read_byte(mtd); id_data[i] = chip->read_byte(mtd);
if (id_data[0] != *maf_id || id_data[1] != *dev_id) { if (id_data[0] != *maf_id || id_data[1] != *dev_id) {
printk(KERN_INFO "%s: second ID read did not match " pr_info("%s: second ID read did not match "
"%02x,%02x against %02x,%02x\n", __func__, "%02x,%02x against %02x,%02x\n", __func__,
*maf_id, *dev_id, id_data[0], id_data[1]); *maf_id, *dev_id, id_data[0], id_data[1]);
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
...@@ -3077,10 +3077,10 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd, ...@@ -3077,10 +3077,10 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
* chip correct! * chip correct!
*/ */
if (busw != (chip->options & NAND_BUSWIDTH_16)) { if (busw != (chip->options & NAND_BUSWIDTH_16)) {
printk(KERN_INFO "NAND device: Manufacturer ID:" pr_info("NAND device: Manufacturer ID:"
" 0x%02x, Chip ID: 0x%02x (%s %s)\n", *maf_id, " 0x%02x, Chip ID: 0x%02x (%s %s)\n", *maf_id,
*dev_id, nand_manuf_ids[maf_idx].name, mtd->name); *dev_id, nand_manuf_ids[maf_idx].name, mtd->name);
printk(KERN_WARNING "NAND bus width %d instead %d bit\n", pr_warn("NAND bus width %d instead %d bit\n",
(chip->options & NAND_BUSWIDTH_16) ? 16 : 8, (chip->options & NAND_BUSWIDTH_16) ? 16 : 8,
busw ? 16 : 8); busw ? 16 : 8);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
...@@ -3138,7 +3138,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd, ...@@ -3138,7 +3138,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
if (mtd->writesize > 512 && chip->cmdfunc == nand_command) if (mtd->writesize > 512 && chip->cmdfunc == nand_command)
chip->cmdfunc = nand_command_lp; chip->cmdfunc = nand_command_lp;
printk(KERN_INFO "NAND device: Manufacturer ID:" pr_info("NAND device: Manufacturer ID:"
" 0x%02x, Chip ID: 0x%02x (%s %s)\n", *maf_id, *dev_id, " 0x%02x, Chip ID: 0x%02x (%s %s)\n", *maf_id, *dev_id,
nand_manuf_ids[maf_idx].name, nand_manuf_ids[maf_idx].name,
chip->onfi_version ? chip->onfi_params.model : type->name); chip->onfi_version ? chip->onfi_params.model : type->name);
...@@ -3175,7 +3175,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips, ...@@ -3175,7 +3175,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips,
if (IS_ERR(type)) { if (IS_ERR(type)) {
if (!(chip->options & NAND_SCAN_SILENT_NODEV)) if (!(chip->options & NAND_SCAN_SILENT_NODEV))
printk(KERN_WARNING "No NAND device found.\n"); pr_warn("No NAND device found.\n");
chip->select_chip(mtd, -1); chip->select_chip(mtd, -1);
return PTR_ERR(type); return PTR_ERR(type);
} }
...@@ -3193,7 +3193,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips, ...@@ -3193,7 +3193,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips,
break; break;
} }
if (i > 1) if (i > 1)
printk(KERN_INFO "%d NAND chips detected\n", i); pr_info("%d NAND chips detected\n", i);
/* Store the number of chips and calc total size for mtd */ /* Store the number of chips and calc total size for mtd */
chip->numchips = i; chip->numchips = i;
...@@ -3243,7 +3243,7 @@ int nand_scan_tail(struct mtd_info *mtd) ...@@ -3243,7 +3243,7 @@ int nand_scan_tail(struct mtd_info *mtd)
chip->ecc.layout = &nand_oob_128; chip->ecc.layout = &nand_oob_128;
break; break;
default: default:
printk(KERN_WARNING "No oob scheme defined for " pr_warn("No oob scheme defined for "
"oobsize %d\n", mtd->oobsize); "oobsize %d\n", mtd->oobsize);
BUG(); BUG();
} }
...@@ -3262,7 +3262,7 @@ int nand_scan_tail(struct mtd_info *mtd) ...@@ -3262,7 +3262,7 @@ int nand_scan_tail(struct mtd_info *mtd)
/* Similar to NAND_ECC_HW, but a separate read_page handle */ /* Similar to NAND_ECC_HW, but a separate read_page handle */
if (!chip->ecc.calculate || !chip->ecc.correct || if (!chip->ecc.calculate || !chip->ecc.correct ||
!chip->ecc.hwctl) { !chip->ecc.hwctl) {
printk(KERN_WARNING "No ECC functions supplied; " pr_warn("No ECC functions supplied; "
"Hardware ECC not possible\n"); "Hardware ECC not possible\n");
BUG(); BUG();
} }
...@@ -3291,7 +3291,7 @@ int nand_scan_tail(struct mtd_info *mtd) ...@@ -3291,7 +3291,7 @@ int nand_scan_tail(struct mtd_info *mtd)
chip->ecc.read_page == nand_read_page_hwecc || chip->ecc.read_page == nand_read_page_hwecc ||
!chip->ecc.write_page || !chip->ecc.write_page ||
chip->ecc.write_page == nand_write_page_hwecc)) { chip->ecc.write_page == nand_write_page_hwecc)) {
printk(KERN_WARNING "No ECC functions supplied; " pr_warn("No ECC functions supplied; "
"Hardware ECC not possible\n"); "Hardware ECC not possible\n");
BUG(); BUG();
} }
...@@ -3311,7 +3311,7 @@ int nand_scan_tail(struct mtd_info *mtd) ...@@ -3311,7 +3311,7 @@ int nand_scan_tail(struct mtd_info *mtd)
if (mtd->writesize >= chip->ecc.size) if (mtd->writesize >= chip->ecc.size)
break; break;
printk(KERN_WARNING "%d byte HW ECC not possible on " pr_warn("%d byte HW ECC not possible on "
"%d byte page size, fallback to SW ECC\n", "%d byte page size, fallback to SW ECC\n",
chip->ecc.size, mtd->writesize); chip->ecc.size, mtd->writesize);
chip->ecc.mode = NAND_ECC_SOFT; chip->ecc.mode = NAND_ECC_SOFT;
...@@ -3333,7 +3333,7 @@ int nand_scan_tail(struct mtd_info *mtd) ...@@ -3333,7 +3333,7 @@ int nand_scan_tail(struct mtd_info *mtd)
case NAND_ECC_SOFT_BCH: case NAND_ECC_SOFT_BCH:
if (!mtd_nand_has_bch()) { if (!mtd_nand_has_bch()) {
printk(KERN_WARNING "CONFIG_MTD_ECC_BCH not enabled\n"); pr_warn("CONFIG_MTD_ECC_BCH not enabled\n");
BUG(); BUG();
} }
chip->ecc.calculate = nand_bch_calculate_ecc; chip->ecc.calculate = nand_bch_calculate_ecc;
...@@ -3360,13 +3360,13 @@ int nand_scan_tail(struct mtd_info *mtd) ...@@ -3360,13 +3360,13 @@ int nand_scan_tail(struct mtd_info *mtd)
chip->ecc.bytes, chip->ecc.bytes,
&chip->ecc.layout); &chip->ecc.layout);
if (!chip->ecc.priv) { if (!chip->ecc.priv) {
printk(KERN_WARNING "BCH ECC initialization failed!\n"); pr_warn("BCH ECC initialization failed!\n");
BUG(); BUG();
} }
break; break;
case NAND_ECC_NONE: case NAND_ECC_NONE:
printk(KERN_WARNING "NAND_ECC_NONE selected by board driver. " pr_warn("NAND_ECC_NONE selected by board driver. "
"This is not recommended !!\n"); "This is not recommended !!\n");
chip->ecc.read_page = nand_read_page_raw; chip->ecc.read_page = nand_read_page_raw;
chip->ecc.write_page = nand_write_page_raw; chip->ecc.write_page = nand_write_page_raw;
...@@ -3379,7 +3379,7 @@ int nand_scan_tail(struct mtd_info *mtd) ...@@ -3379,7 +3379,7 @@ int nand_scan_tail(struct mtd_info *mtd)
break; break;
default: default:
printk(KERN_WARNING "Invalid NAND_ECC_MODE %d\n", pr_warn("Invalid NAND_ECC_MODE %d\n",
chip->ecc.mode); chip->ecc.mode);
BUG(); BUG();
} }
...@@ -3401,7 +3401,7 @@ int nand_scan_tail(struct mtd_info *mtd) ...@@ -3401,7 +3401,7 @@ int nand_scan_tail(struct mtd_info *mtd)
*/ */
chip->ecc.steps = mtd->writesize / chip->ecc.size; chip->ecc.steps = mtd->writesize / chip->ecc.size;
if (chip->ecc.steps * chip->ecc.size != mtd->writesize) { if (chip->ecc.steps * chip->ecc.size != mtd->writesize) {
printk(KERN_WARNING "Invalid ECC parameters\n"); pr_warn("Invalid ECC parameters\n");
BUG(); BUG();
} }
chip->ecc.total = chip->ecc.steps * chip->ecc.bytes; chip->ecc.total = chip->ecc.steps * chip->ecc.bytes;
...@@ -3492,7 +3492,7 @@ int nand_scan(struct mtd_info *mtd, int maxchips) ...@@ -3492,7 +3492,7 @@ int nand_scan(struct mtd_info *mtd, int maxchips)
/* Many callers got this wrong, so check for it for a while... */ /* Many callers got this wrong, so check for it for a while... */
if (!mtd->owner && caller_is_module()) { if (!mtd->owner && caller_is_module()) {
printk(KERN_CRIT "%s called with NULL mtd->owner!\n", pr_crit("%s called with NULL mtd->owner!\n",
__func__); __func__);
BUG(); BUG();
} }
......
...@@ -205,10 +205,10 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num, ...@@ -205,10 +205,10 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num,
res = mtd->read(mtd, from, len, &retlen, buf); res = mtd->read(mtd, from, len, &retlen, buf);
if (res < 0) { if (res < 0) {
if (retlen != len) { if (retlen != len) {
printk(KERN_INFO "nand_bbt: Error reading bad block table\n"); pr_info("nand_bbt: Error reading bad block table\n");
return res; return res;
} }
printk(KERN_WARNING "nand_bbt: ECC error while reading bad block table\n"); pr_warn("nand_bbt: ECC error while reading bad block table\n");
} }
/* Analyse data */ /* Analyse data */
...@@ -219,7 +219,7 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num, ...@@ -219,7 +219,7 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num,
if (tmp == msk) if (tmp == msk)
continue; continue;
if (reserved_block_code && (tmp == reserved_block_code)) { if (reserved_block_code && (tmp == reserved_block_code)) {
printk(KERN_INFO "nand_read_bbt: Reserved block at 0x%012llx\n", pr_info("nand_read_bbt: Reserved block at 0x%012llx\n",
(loff_t)((offs << 2) + (act >> 1)) << this->bbt_erase_shift); (loff_t)((offs << 2) + (act >> 1)) << this->bbt_erase_shift);
this->bbt[offs + (act >> 3)] |= 0x2 << (act & 0x06); this->bbt[offs + (act >> 3)] |= 0x2 << (act & 0x06);
mtd->ecc_stats.bbtblocks++; mtd->ecc_stats.bbtblocks++;
...@@ -229,7 +229,7 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num, ...@@ -229,7 +229,7 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num,
* Leave it for now, if it's matured we can * Leave it for now, if it's matured we can
* move this message to pr_debug. * move this message to pr_debug.
*/ */
printk(KERN_INFO "nand_read_bbt: Bad block at 0x%012llx\n", pr_info("nand_read_bbt: Bad block at 0x%012llx\n",
(loff_t)((offs << 2) + (act >> 1)) << this->bbt_erase_shift); (loff_t)((offs << 2) + (act >> 1)) << this->bbt_erase_shift);
/* Factory marked bad or worn out? */ /* Factory marked bad or worn out? */
if (tmp == 0) if (tmp == 0)
...@@ -389,7 +389,7 @@ static int read_abs_bbts(struct mtd_info *mtd, uint8_t *buf, ...@@ -389,7 +389,7 @@ static int read_abs_bbts(struct mtd_info *mtd, uint8_t *buf,
scan_read_raw(mtd, buf, (loff_t)td->pages[0] << this->page_shift, scan_read_raw(mtd, buf, (loff_t)td->pages[0] << this->page_shift,
mtd->writesize, td); mtd->writesize, td);
td->version[0] = buf[bbt_get_ver_offs(mtd, td)]; td->version[0] = buf[bbt_get_ver_offs(mtd, td)];
printk(KERN_INFO "Bad block table at page %d, version 0x%02X\n", pr_info("Bad block table at page %d, version 0x%02X\n",
td->pages[0], td->version[0]); td->pages[0], td->version[0]);
} }
...@@ -398,7 +398,7 @@ static int read_abs_bbts(struct mtd_info *mtd, uint8_t *buf, ...@@ -398,7 +398,7 @@ static int read_abs_bbts(struct mtd_info *mtd, uint8_t *buf,
scan_read_raw(mtd, buf, (loff_t)md->pages[0] << this->page_shift, scan_read_raw(mtd, buf, (loff_t)md->pages[0] << this->page_shift,
mtd->writesize, td); mtd->writesize, td);
md->version[0] = buf[bbt_get_ver_offs(mtd, md)]; md->version[0] = buf[bbt_get_ver_offs(mtd, md)];
printk(KERN_INFO "Bad block table at page %d, version 0x%02X\n", pr_info("Bad block table at page %d, version 0x%02X\n",
md->pages[0], md->version[0]); md->pages[0], md->version[0]);
} }
return 1; return 1;
...@@ -473,7 +473,7 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf, ...@@ -473,7 +473,7 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf,
loff_t from; loff_t from;
size_t readlen; size_t readlen;
printk(KERN_INFO "Scanning device for bad blocks\n"); pr_info("Scanning device for bad blocks\n");
if (bd->options & NAND_BBT_SCANALLPAGES) if (bd->options & NAND_BBT_SCANALLPAGES)
len = 1 << (this->bbt_erase_shift - this->page_shift); len = 1 << (this->bbt_erase_shift - this->page_shift);
...@@ -502,7 +502,7 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf, ...@@ -502,7 +502,7 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf,
from = 0; from = 0;
} else { } else {
if (chip >= this->numchips) { if (chip >= this->numchips) {
printk(KERN_WARNING "create_bbt(): chipnr (%d) > available chips (%d)\n", pr_warn("create_bbt(): chipnr (%d) > available chips (%d)\n",
chip + 1, this->numchips); chip + 1, this->numchips);
return -EINVAL; return -EINVAL;
} }
...@@ -531,7 +531,7 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf, ...@@ -531,7 +531,7 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf,
if (ret) { if (ret) {
this->bbt[i >> 3] |= 0x03 << (i & 0x6); this->bbt[i >> 3] |= 0x03 << (i & 0x6);
printk(KERN_WARNING "Bad eraseblock %d at 0x%012llx\n", pr_warn("Bad eraseblock %d at 0x%012llx\n",
i >> 1, (unsigned long long)from); i >> 1, (unsigned long long)from);
mtd->ecc_stats.badblocks++; mtd->ecc_stats.badblocks++;
} }
...@@ -614,9 +614,9 @@ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr ...@@ -614,9 +614,9 @@ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr
/* Check, if we found a bbt for each requested chip */ /* Check, if we found a bbt for each requested chip */
for (i = 0; i < chips; i++) { for (i = 0; i < chips; i++) {
if (td->pages[i] == -1) if (td->pages[i] == -1)
printk(KERN_WARNING "Bad block table not found for chip %d\n", i); pr_warn("Bad block table not found for chip %d\n", i);
else else
printk(KERN_INFO "Bad block table found at page %d, version 0x%02X\n", td->pages[i], pr_info("Bad block table found at page %d, version 0x%02X\n", td->pages[i],
td->version[i]); td->version[i]);
} }
return 0; return 0;
...@@ -730,7 +730,7 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf, ...@@ -730,7 +730,7 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf,
if (!md || md->pages[chip] != page) if (!md || md->pages[chip] != page)
goto write; goto write;
} }
printk(KERN_ERR "No space left to write bad block table\n"); pr_err("No space left to write bad block table\n");
return -ENOSPC; return -ENOSPC;
write: write:
...@@ -765,12 +765,12 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf, ...@@ -765,12 +765,12 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf,
res = mtd->read(mtd, to, len, &retlen, buf); res = mtd->read(mtd, to, len, &retlen, buf);
if (res < 0) { if (res < 0) {
if (retlen != len) { if (retlen != len) {
printk(KERN_INFO "nand_bbt: Error " pr_info("nand_bbt: Error "
"reading block for writing " "reading block for writing "
"the bad block table\n"); "the bad block table\n");
return res; return res;
} }
printk(KERN_WARNING "nand_bbt: ECC error " pr_warn("nand_bbt: ECC error "
"while reading block for writing " "while reading block for writing "
"bad block table\n"); "bad block table\n");
} }
...@@ -847,7 +847,7 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf, ...@@ -847,7 +847,7 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf,
if (res < 0) if (res < 0)
goto outerr; goto outerr;
printk(KERN_INFO "Bad block table written to 0x%012llx, version " pr_info("Bad block table written to 0x%012llx, version "
"0x%02X\n", (unsigned long long)to, td->version[chip]); "0x%02X\n", (unsigned long long)to, td->version[chip]);
/* Mark it as used */ /* Mark it as used */
...@@ -1137,7 +1137,7 @@ int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd) ...@@ -1137,7 +1137,7 @@ int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd)
*/ */
if (!td) { if (!td) {
if ((res = nand_memory_bbt(mtd, bd))) { if ((res = nand_memory_bbt(mtd, bd))) {
printk(KERN_ERR "nand_bbt: Can't scan flash and build the RAM-based BBT\n"); pr_err("nand_bbt: Can't scan flash and build the RAM-based BBT\n");
kfree(this->bbt); kfree(this->bbt);
this->bbt = NULL; this->bbt = NULL;
} }
...@@ -1305,7 +1305,7 @@ static int nand_create_default_bbt_descr(struct nand_chip *this) ...@@ -1305,7 +1305,7 @@ static int nand_create_default_bbt_descr(struct nand_chip *this)
{ {
struct nand_bbt_descr *bd; struct nand_bbt_descr *bd;
if (this->badblock_pattern) { if (this->badblock_pattern) {
printk(KERN_WARNING "BBT descr already allocated; not replacing.\n"); pr_warn("BBT descr already allocated; not replacing.\n");
return -EINVAL; return -EINVAL;
} }
bd = kzalloc(sizeof(*bd), GFP_KERNEL); bd = kzalloc(sizeof(*bd), GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment