diff options
author | Brian Norris <computersforpeace@gmail.com> | 2011-07-19 13:06:07 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-11 08:02:15 -0400 |
commit | 9a4d4d69018e7b719ba58fa30fcdd60e547776b8 (patch) | |
tree | ba8268500b7abe8c61d3a77d7be7466e55f141bc | |
parent | a0f5080ecc1c75f9c08591d9b0f48451e7ac8ddc (diff) |
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.html
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 44 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_bbt.c | 34 |
2 files changed, 39 insertions, 39 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 250e86f5592e..1d6c81aef779 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -2179,7 +2179,7 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to, | |||
2179 | 2179 | ||
2180 | /* Reject writes, which are not page aligned */ | 2180 | /* Reject writes, which are not page aligned */ |
2181 | if (NOTALIGNED(to) || NOTALIGNED(ops->len)) { | 2181 | if (NOTALIGNED(to) || NOTALIGNED(ops->len)) { |
2182 | printk(KERN_NOTICE "%s: Attempt to write not " | 2182 | pr_notice("%s: Attempt to write not " |
2183 | "page aligned data\n", __func__); | 2183 | "page aligned data\n", __func__); |
2184 | return -EINVAL; | 2184 | return -EINVAL; |
2185 | } | 2185 | } |
@@ -2570,7 +2570,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, | |||
2570 | /* Heck if we have a bad block, we do not erase bad blocks! */ | 2570 | /* Heck if we have a bad block, we do not erase bad blocks! */ |
2571 | if (nand_block_checkbad(mtd, ((loff_t) page) << | 2571 | if (nand_block_checkbad(mtd, ((loff_t) page) << |
2572 | chip->page_shift, 0, allowbbt)) { | 2572 | chip->page_shift, 0, allowbbt)) { |
2573 | printk(KERN_WARNING "%s: attempt to erase a bad block " | 2573 | pr_warn("%s: attempt to erase a bad block " |
2574 | "at page 0x%08x\n", __func__, page); | 2574 | "at page 0x%08x\n", __func__, page); |
2575 | instr->state = MTD_ERASE_FAILED; | 2575 | instr->state = MTD_ERASE_FAILED; |
2576 | goto erase_exit; | 2576 | goto erase_exit; |
@@ -2744,7 +2744,7 @@ static void nand_resume(struct mtd_info *mtd) | |||
2744 | if (chip->state == FL_PM_SUSPENDED) | 2744 | if (chip->state == FL_PM_SUSPENDED) |
2745 | nand_release_device(mtd); | 2745 | nand_release_device(mtd); |
2746 | else | 2746 | else |
2747 | printk(KERN_ERR "%s called for a chip which is not " | 2747 | pr_err("%s called for a chip which is not " |
2748 | "in suspended state\n", __func__); | 2748 | "in suspended state\n", __func__); |
2749 | } | 2749 | } |
2750 | 2750 | ||
@@ -2836,13 +2836,13 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip, | |||
2836 | chip->read_byte(mtd) != 'F' || chip->read_byte(mtd) != 'I') | 2836 | chip->read_byte(mtd) != 'F' || chip->read_byte(mtd) != 'I') |
2837 | return 0; | 2837 | return 0; |
2838 | 2838 | ||
2839 | printk(KERN_INFO "ONFI flash detected\n"); | 2839 | pr_info("ONFI flash detected\n"); |
2840 | chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1); | 2840 | chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1); |
2841 | for (i = 0; i < 3; i++) { | 2841 | for (i = 0; i < 3; i++) { |
2842 | chip->read_buf(mtd, (uint8_t *)p, sizeof(*p)); | 2842 | chip->read_buf(mtd, (uint8_t *)p, sizeof(*p)); |
2843 | if (onfi_crc16(ONFI_CRC_BASE, (uint8_t *)p, 254) == | 2843 | if (onfi_crc16(ONFI_CRC_BASE, (uint8_t *)p, 254) == |
2844 | le16_to_cpu(p->crc)) { | 2844 | le16_to_cpu(p->crc)) { |
2845 | printk(KERN_INFO "ONFI param page %d valid\n", i); | 2845 | pr_info("ONFI param page %d valid\n", i); |
2846 | break; | 2846 | break; |
2847 | } | 2847 | } |
2848 | } | 2848 | } |
@@ -2866,7 +2866,7 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip, | |||
2866 | chip->onfi_version = 0; | 2866 | chip->onfi_version = 0; |
2867 | 2867 | ||
2868 | if (!chip->onfi_version) { | 2868 | if (!chip->onfi_version) { |
2869 | printk(KERN_INFO "%s: unsupported ONFI version: %d\n", | 2869 | pr_info("%s: unsupported ONFI version: %d\n", |
2870 | __func__, val); | 2870 | __func__, val); |
2871 | return 0; | 2871 | return 0; |
2872 | } | 2872 | } |
@@ -2932,7 +2932,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd, | |||
2932 | id_data[i] = chip->read_byte(mtd); | 2932 | id_data[i] = chip->read_byte(mtd); |
2933 | 2933 | ||
2934 | if (id_data[0] != *maf_id || id_data[1] != *dev_id) { | 2934 | if (id_data[0] != *maf_id || id_data[1] != *dev_id) { |
2935 | printk(KERN_INFO "%s: second ID read did not match " | 2935 | pr_info("%s: second ID read did not match " |
2936 | "%02x,%02x against %02x,%02x\n", __func__, | 2936 | "%02x,%02x against %02x,%02x\n", __func__, |
2937 | *maf_id, *dev_id, id_data[0], id_data[1]); | 2937 | *maf_id, *dev_id, id_data[0], id_data[1]); |
2938 | return ERR_PTR(-ENODEV); | 2938 | return ERR_PTR(-ENODEV); |
@@ -3077,10 +3077,10 @@ ident_done: | |||
3077 | * chip correct! | 3077 | * chip correct! |
3078 | */ | 3078 | */ |
3079 | if (busw != (chip->options & NAND_BUSWIDTH_16)) { | 3079 | if (busw != (chip->options & NAND_BUSWIDTH_16)) { |
3080 | printk(KERN_INFO "NAND device: Manufacturer ID:" | 3080 | pr_info("NAND device: Manufacturer ID:" |
3081 | " 0x%02x, Chip ID: 0x%02x (%s %s)\n", *maf_id, | 3081 | " 0x%02x, Chip ID: 0x%02x (%s %s)\n", *maf_id, |
3082 | *dev_id, nand_manuf_ids[maf_idx].name, mtd->name); | 3082 | *dev_id, nand_manuf_ids[maf_idx].name, mtd->name); |
3083 | printk(KERN_WARNING "NAND bus width %d instead %d bit\n", | 3083 | pr_warn("NAND bus width %d instead %d bit\n", |
3084 | (chip->options & NAND_BUSWIDTH_16) ? 16 : 8, | 3084 | (chip->options & NAND_BUSWIDTH_16) ? 16 : 8, |
3085 | busw ? 16 : 8); | 3085 | busw ? 16 : 8); |
3086 | return ERR_PTR(-EINVAL); | 3086 | return ERR_PTR(-EINVAL); |
@@ -3138,7 +3138,7 @@ ident_done: | |||
3138 | if (mtd->writesize > 512 && chip->cmdfunc == nand_command) | 3138 | if (mtd->writesize > 512 && chip->cmdfunc == nand_command) |
3139 | chip->cmdfunc = nand_command_lp; | 3139 | chip->cmdfunc = nand_command_lp; |
3140 | 3140 | ||
3141 | printk(KERN_INFO "NAND device: Manufacturer ID:" | 3141 | pr_info("NAND device: Manufacturer ID:" |
3142 | " 0x%02x, Chip ID: 0x%02x (%s %s)\n", *maf_id, *dev_id, | 3142 | " 0x%02x, Chip ID: 0x%02x (%s %s)\n", *maf_id, *dev_id, |
3143 | nand_manuf_ids[maf_idx].name, | 3143 | nand_manuf_ids[maf_idx].name, |
3144 | chip->onfi_version ? chip->onfi_params.model : type->name); | 3144 | chip->onfi_version ? chip->onfi_params.model : type->name); |
@@ -3175,7 +3175,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips, | |||
3175 | 3175 | ||
3176 | if (IS_ERR(type)) { | 3176 | if (IS_ERR(type)) { |
3177 | if (!(chip->options & NAND_SCAN_SILENT_NODEV)) | 3177 | if (!(chip->options & NAND_SCAN_SILENT_NODEV)) |
3178 | printk(KERN_WARNING "No NAND device found.\n"); | 3178 | pr_warn("No NAND device found.\n"); |
3179 | chip->select_chip(mtd, -1); | 3179 | chip->select_chip(mtd, -1); |
3180 | return PTR_ERR(type); | 3180 | return PTR_ERR(type); |
3181 | } | 3181 | } |
@@ -3193,7 +3193,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips, | |||
3193 | break; | 3193 | break; |
3194 | } | 3194 | } |
3195 | if (i > 1) | 3195 | if (i > 1) |
3196 | printk(KERN_INFO "%d NAND chips detected\n", i); | 3196 | pr_info("%d NAND chips detected\n", i); |
3197 | 3197 | ||
3198 | /* Store the number of chips and calc total size for mtd */ | 3198 | /* Store the number of chips and calc total size for mtd */ |
3199 | chip->numchips = i; | 3199 | chip->numchips = i; |
@@ -3243,7 +3243,7 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
3243 | chip->ecc.layout = &nand_oob_128; | 3243 | chip->ecc.layout = &nand_oob_128; |
3244 | break; | 3244 | break; |
3245 | default: | 3245 | default: |
3246 | printk(KERN_WARNING "No oob scheme defined for " | 3246 | pr_warn("No oob scheme defined for " |
3247 | "oobsize %d\n", mtd->oobsize); | 3247 | "oobsize %d\n", mtd->oobsize); |
3248 | BUG(); | 3248 | BUG(); |
3249 | } | 3249 | } |
@@ -3262,7 +3262,7 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
3262 | /* Similar to NAND_ECC_HW, but a separate read_page handle */ | 3262 | /* Similar to NAND_ECC_HW, but a separate read_page handle */ |
3263 | if (!chip->ecc.calculate || !chip->ecc.correct || | 3263 | if (!chip->ecc.calculate || !chip->ecc.correct || |
3264 | !chip->ecc.hwctl) { | 3264 | !chip->ecc.hwctl) { |
3265 | printk(KERN_WARNING "No ECC functions supplied; " | 3265 | pr_warn("No ECC functions supplied; " |
3266 | "Hardware ECC not possible\n"); | 3266 | "Hardware ECC not possible\n"); |
3267 | BUG(); | 3267 | BUG(); |
3268 | } | 3268 | } |
@@ -3291,7 +3291,7 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
3291 | chip->ecc.read_page == nand_read_page_hwecc || | 3291 | chip->ecc.read_page == nand_read_page_hwecc || |
3292 | !chip->ecc.write_page || | 3292 | !chip->ecc.write_page || |
3293 | chip->ecc.write_page == nand_write_page_hwecc)) { | 3293 | chip->ecc.write_page == nand_write_page_hwecc)) { |
3294 | printk(KERN_WARNING "No ECC functions supplied; " | 3294 | pr_warn("No ECC functions supplied; " |
3295 | "Hardware ECC not possible\n"); | 3295 | "Hardware ECC not possible\n"); |
3296 | BUG(); | 3296 | BUG(); |
3297 | } | 3297 | } |
@@ -3311,7 +3311,7 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
3311 | 3311 | ||
3312 | if (mtd->writesize >= chip->ecc.size) | 3312 | if (mtd->writesize >= chip->ecc.size) |
3313 | break; | 3313 | break; |
3314 | printk(KERN_WARNING "%d byte HW ECC not possible on " | 3314 | pr_warn("%d byte HW ECC not possible on " |
3315 | "%d byte page size, fallback to SW ECC\n", | 3315 | "%d byte page size, fallback to SW ECC\n", |
3316 | chip->ecc.size, mtd->writesize); | 3316 | chip->ecc.size, mtd->writesize); |
3317 | chip->ecc.mode = NAND_ECC_SOFT; | 3317 | chip->ecc.mode = NAND_ECC_SOFT; |
@@ -3333,7 +3333,7 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
3333 | 3333 | ||
3334 | case NAND_ECC_SOFT_BCH: | 3334 | case NAND_ECC_SOFT_BCH: |
3335 | if (!mtd_nand_has_bch()) { | 3335 | if (!mtd_nand_has_bch()) { |
3336 | printk(KERN_WARNING "CONFIG_MTD_ECC_BCH not enabled\n"); | 3336 | pr_warn("CONFIG_MTD_ECC_BCH not enabled\n"); |
3337 | BUG(); | 3337 | BUG(); |
3338 | } | 3338 | } |
3339 | chip->ecc.calculate = nand_bch_calculate_ecc; | 3339 | chip->ecc.calculate = nand_bch_calculate_ecc; |
@@ -3360,13 +3360,13 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
3360 | chip->ecc.bytes, | 3360 | chip->ecc.bytes, |
3361 | &chip->ecc.layout); | 3361 | &chip->ecc.layout); |
3362 | if (!chip->ecc.priv) { | 3362 | if (!chip->ecc.priv) { |
3363 | printk(KERN_WARNING "BCH ECC initialization failed!\n"); | 3363 | pr_warn("BCH ECC initialization failed!\n"); |
3364 | BUG(); | 3364 | BUG(); |
3365 | } | 3365 | } |
3366 | break; | 3366 | break; |
3367 | 3367 | ||
3368 | case NAND_ECC_NONE: | 3368 | case NAND_ECC_NONE: |
3369 | printk(KERN_WARNING "NAND_ECC_NONE selected by board driver. " | 3369 | pr_warn("NAND_ECC_NONE selected by board driver. " |
3370 | "This is not recommended !!\n"); | 3370 | "This is not recommended !!\n"); |
3371 | chip->ecc.read_page = nand_read_page_raw; | 3371 | chip->ecc.read_page = nand_read_page_raw; |
3372 | chip->ecc.write_page = nand_write_page_raw; | 3372 | chip->ecc.write_page = nand_write_page_raw; |
@@ -3379,7 +3379,7 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
3379 | break; | 3379 | break; |
3380 | 3380 | ||
3381 | default: | 3381 | default: |
3382 | printk(KERN_WARNING "Invalid NAND_ECC_MODE %d\n", | 3382 | pr_warn("Invalid NAND_ECC_MODE %d\n", |
3383 | chip->ecc.mode); | 3383 | chip->ecc.mode); |
3384 | BUG(); | 3384 | BUG(); |
3385 | } | 3385 | } |
@@ -3401,7 +3401,7 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
3401 | */ | 3401 | */ |
3402 | chip->ecc.steps = mtd->writesize / chip->ecc.size; | 3402 | chip->ecc.steps = mtd->writesize / chip->ecc.size; |
3403 | if (chip->ecc.steps * chip->ecc.size != mtd->writesize) { | 3403 | if (chip->ecc.steps * chip->ecc.size != mtd->writesize) { |
3404 | printk(KERN_WARNING "Invalid ECC parameters\n"); | 3404 | pr_warn("Invalid ECC parameters\n"); |
3405 | BUG(); | 3405 | BUG(); |
3406 | } | 3406 | } |
3407 | chip->ecc.total = chip->ecc.steps * chip->ecc.bytes; | 3407 | chip->ecc.total = chip->ecc.steps * chip->ecc.bytes; |
@@ -3492,7 +3492,7 @@ int nand_scan(struct mtd_info *mtd, int maxchips) | |||
3492 | 3492 | ||
3493 | /* Many callers got this wrong, so check for it for a while... */ | 3493 | /* Many callers got this wrong, so check for it for a while... */ |
3494 | if (!mtd->owner && caller_is_module()) { | 3494 | if (!mtd->owner && caller_is_module()) { |
3495 | printk(KERN_CRIT "%s called with NULL mtd->owner!\n", | 3495 | pr_crit("%s called with NULL mtd->owner!\n", |
3496 | __func__); | 3496 | __func__); |
3497 | BUG(); | 3497 | BUG(); |
3498 | } | 3498 | } |
diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index 0d2eaa72288f..76f496d2bfed 100644 --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c | |||
@@ -205,10 +205,10 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num, | |||
205 | res = mtd->read(mtd, from, len, &retlen, buf); | 205 | res = mtd->read(mtd, from, len, &retlen, buf); |
206 | if (res < 0) { | 206 | if (res < 0) { |
207 | if (retlen != len) { | 207 | if (retlen != len) { |
208 | printk(KERN_INFO "nand_bbt: Error reading bad block table\n"); | 208 | pr_info("nand_bbt: Error reading bad block table\n"); |
209 | return res; | 209 | return res; |
210 | } | 210 | } |
211 | printk(KERN_WARNING "nand_bbt: ECC error while reading bad block table\n"); | 211 | pr_warn("nand_bbt: ECC error while reading bad block table\n"); |
212 | } | 212 | } |
213 | 213 | ||
214 | /* Analyse data */ | 214 | /* Analyse data */ |
@@ -219,7 +219,7 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num, | |||
219 | if (tmp == msk) | 219 | if (tmp == msk) |
220 | continue; | 220 | continue; |
221 | if (reserved_block_code && (tmp == reserved_block_code)) { | 221 | if (reserved_block_code && (tmp == reserved_block_code)) { |
222 | printk(KERN_INFO "nand_read_bbt: Reserved block at 0x%012llx\n", | 222 | pr_info("nand_read_bbt: Reserved block at 0x%012llx\n", |
223 | (loff_t)((offs << 2) + (act >> 1)) << this->bbt_erase_shift); | 223 | (loff_t)((offs << 2) + (act >> 1)) << this->bbt_erase_shift); |
224 | this->bbt[offs + (act >> 3)] |= 0x2 << (act & 0x06); | 224 | this->bbt[offs + (act >> 3)] |= 0x2 << (act & 0x06); |
225 | mtd->ecc_stats.bbtblocks++; | 225 | mtd->ecc_stats.bbtblocks++; |
@@ -229,7 +229,7 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num, | |||
229 | * Leave it for now, if it's matured we can | 229 | * Leave it for now, if it's matured we can |
230 | * move this message to pr_debug. | 230 | * move this message to pr_debug. |
231 | */ | 231 | */ |
232 | printk(KERN_INFO "nand_read_bbt: Bad block at 0x%012llx\n", | 232 | pr_info("nand_read_bbt: Bad block at 0x%012llx\n", |
233 | (loff_t)((offs << 2) + (act >> 1)) << this->bbt_erase_shift); | 233 | (loff_t)((offs << 2) + (act >> 1)) << this->bbt_erase_shift); |
234 | /* Factory marked bad or worn out? */ | 234 | /* Factory marked bad or worn out? */ |
235 | if (tmp == 0) | 235 | if (tmp == 0) |
@@ -389,7 +389,7 @@ static int read_abs_bbts(struct mtd_info *mtd, uint8_t *buf, | |||
389 | scan_read_raw(mtd, buf, (loff_t)td->pages[0] << this->page_shift, | 389 | scan_read_raw(mtd, buf, (loff_t)td->pages[0] << this->page_shift, |
390 | mtd->writesize, td); | 390 | mtd->writesize, td); |
391 | td->version[0] = buf[bbt_get_ver_offs(mtd, td)]; | 391 | td->version[0] = buf[bbt_get_ver_offs(mtd, td)]; |
392 | printk(KERN_INFO "Bad block table at page %d, version 0x%02X\n", | 392 | pr_info("Bad block table at page %d, version 0x%02X\n", |
393 | td->pages[0], td->version[0]); | 393 | td->pages[0], td->version[0]); |
394 | } | 394 | } |
395 | 395 | ||
@@ -398,7 +398,7 @@ static int read_abs_bbts(struct mtd_info *mtd, uint8_t *buf, | |||
398 | scan_read_raw(mtd, buf, (loff_t)md->pages[0] << this->page_shift, | 398 | scan_read_raw(mtd, buf, (loff_t)md->pages[0] << this->page_shift, |
399 | mtd->writesize, td); | 399 | mtd->writesize, td); |
400 | md->version[0] = buf[bbt_get_ver_offs(mtd, md)]; | 400 | md->version[0] = buf[bbt_get_ver_offs(mtd, md)]; |
401 | printk(KERN_INFO "Bad block table at page %d, version 0x%02X\n", | 401 | pr_info("Bad block table at page %d, version 0x%02X\n", |
402 | md->pages[0], md->version[0]); | 402 | md->pages[0], md->version[0]); |
403 | } | 403 | } |
404 | return 1; | 404 | return 1; |
@@ -473,7 +473,7 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf, | |||
473 | loff_t from; | 473 | loff_t from; |
474 | size_t readlen; | 474 | size_t readlen; |
475 | 475 | ||
476 | printk(KERN_INFO "Scanning device for bad blocks\n"); | 476 | pr_info("Scanning device for bad blocks\n"); |
477 | 477 | ||
478 | if (bd->options & NAND_BBT_SCANALLPAGES) | 478 | if (bd->options & NAND_BBT_SCANALLPAGES) |
479 | len = 1 << (this->bbt_erase_shift - this->page_shift); | 479 | 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 | from = 0; | 502 | from = 0; |
503 | } else { | 503 | } else { |
504 | if (chip >= this->numchips) { | 504 | if (chip >= this->numchips) { |
505 | printk(KERN_WARNING "create_bbt(): chipnr (%d) > available chips (%d)\n", | 505 | pr_warn("create_bbt(): chipnr (%d) > available chips (%d)\n", |
506 | chip + 1, this->numchips); | 506 | chip + 1, this->numchips); |
507 | return -EINVAL; | 507 | return -EINVAL; |
508 | } | 508 | } |
@@ -531,7 +531,7 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf, | |||
531 | 531 | ||
532 | if (ret) { | 532 | if (ret) { |
533 | this->bbt[i >> 3] |= 0x03 << (i & 0x6); | 533 | this->bbt[i >> 3] |= 0x03 << (i & 0x6); |
534 | printk(KERN_WARNING "Bad eraseblock %d at 0x%012llx\n", | 534 | pr_warn("Bad eraseblock %d at 0x%012llx\n", |
535 | i >> 1, (unsigned long long)from); | 535 | i >> 1, (unsigned long long)from); |
536 | mtd->ecc_stats.badblocks++; | 536 | mtd->ecc_stats.badblocks++; |
537 | } | 537 | } |
@@ -614,9 +614,9 @@ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr | |||
614 | /* Check, if we found a bbt for each requested chip */ | 614 | /* Check, if we found a bbt for each requested chip */ |
615 | for (i = 0; i < chips; i++) { | 615 | for (i = 0; i < chips; i++) { |
616 | if (td->pages[i] == -1) | 616 | if (td->pages[i] == -1) |
617 | printk(KERN_WARNING "Bad block table not found for chip %d\n", i); | 617 | pr_warn("Bad block table not found for chip %d\n", i); |
618 | else | 618 | else |
619 | printk(KERN_INFO "Bad block table found at page %d, version 0x%02X\n", td->pages[i], | 619 | pr_info("Bad block table found at page %d, version 0x%02X\n", td->pages[i], |
620 | td->version[i]); | 620 | td->version[i]); |
621 | } | 621 | } |
622 | return 0; | 622 | return 0; |
@@ -730,7 +730,7 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf, | |||
730 | if (!md || md->pages[chip] != page) | 730 | if (!md || md->pages[chip] != page) |
731 | goto write; | 731 | goto write; |
732 | } | 732 | } |
733 | printk(KERN_ERR "No space left to write bad block table\n"); | 733 | pr_err("No space left to write bad block table\n"); |
734 | return -ENOSPC; | 734 | return -ENOSPC; |
735 | write: | 735 | write: |
736 | 736 | ||
@@ -765,12 +765,12 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf, | |||
765 | res = mtd->read(mtd, to, len, &retlen, buf); | 765 | res = mtd->read(mtd, to, len, &retlen, buf); |
766 | if (res < 0) { | 766 | if (res < 0) { |
767 | if (retlen != len) { | 767 | if (retlen != len) { |
768 | printk(KERN_INFO "nand_bbt: Error " | 768 | pr_info("nand_bbt: Error " |
769 | "reading block for writing " | 769 | "reading block for writing " |
770 | "the bad block table\n"); | 770 | "the bad block table\n"); |
771 | return res; | 771 | return res; |
772 | } | 772 | } |
773 | printk(KERN_WARNING "nand_bbt: ECC error " | 773 | pr_warn("nand_bbt: ECC error " |
774 | "while reading block for writing " | 774 | "while reading block for writing " |
775 | "bad block table\n"); | 775 | "bad block table\n"); |
776 | } | 776 | } |
@@ -847,7 +847,7 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf, | |||
847 | if (res < 0) | 847 | if (res < 0) |
848 | goto outerr; | 848 | goto outerr; |
849 | 849 | ||
850 | printk(KERN_INFO "Bad block table written to 0x%012llx, version " | 850 | pr_info("Bad block table written to 0x%012llx, version " |
851 | "0x%02X\n", (unsigned long long)to, td->version[chip]); | 851 | "0x%02X\n", (unsigned long long)to, td->version[chip]); |
852 | 852 | ||
853 | /* Mark it as used */ | 853 | /* Mark it as used */ |
@@ -1137,7 +1137,7 @@ int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd) | |||
1137 | */ | 1137 | */ |
1138 | if (!td) { | 1138 | if (!td) { |
1139 | if ((res = nand_memory_bbt(mtd, bd))) { | 1139 | if ((res = nand_memory_bbt(mtd, bd))) { |
1140 | printk(KERN_ERR "nand_bbt: Can't scan flash and build the RAM-based BBT\n"); | 1140 | pr_err("nand_bbt: Can't scan flash and build the RAM-based BBT\n"); |
1141 | kfree(this->bbt); | 1141 | kfree(this->bbt); |
1142 | this->bbt = NULL; | 1142 | this->bbt = NULL; |
1143 | } | 1143 | } |
@@ -1305,7 +1305,7 @@ static int nand_create_default_bbt_descr(struct nand_chip *this) | |||
1305 | { | 1305 | { |
1306 | struct nand_bbt_descr *bd; | 1306 | struct nand_bbt_descr *bd; |
1307 | if (this->badblock_pattern) { | 1307 | if (this->badblock_pattern) { |
1308 | printk(KERN_WARNING "BBT descr already allocated; not replacing.\n"); | 1308 | pr_warn("BBT descr already allocated; not replacing.\n"); |
1309 | return -EINVAL; | 1309 | return -EINVAL; |
1310 | } | 1310 | } |
1311 | bd = kzalloc(sizeof(*bd), GFP_KERNEL); | 1311 | bd = kzalloc(sizeof(*bd), GFP_KERNEL); |