diff options
author | Brian Norris <computersforpeace@gmail.com> | 2011-07-19 13:06:13 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-11 08:02:16 -0400 |
commit | 278981c541b706a5b4b802890020689cd6ee7781 (patch) | |
tree | ce98c62137422b4aa6e7d8da1e3317769c062374 /drivers/mtd | |
parent | 87ed114bb22bc65fce59c709e67599c1940efc7f (diff) |
mtd: cleanup last uses of MTD_DEBUG config macros
Some messages that were tied to CONFIG_MTD_DEBUG_VERBOSE can now simply
be enabled using dynamic debugging features, if necessary. There's no
need for special debugging functions here.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/inftlmount.c | 101 | ||||
-rw-r--r-- | drivers/mtd/maps/pcmciamtd.c | 4 |
2 files changed, 43 insertions, 62 deletions
diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c index bd82b04ec8f..d19898cea55 100644 --- a/drivers/mtd/inftlmount.c +++ b/drivers/mtd/inftlmount.c | |||
@@ -139,24 +139,20 @@ static int find_boot_record(struct INFTLrecord *inftl) | |||
139 | mh->FormatFlags = le32_to_cpu(mh->FormatFlags); | 139 | mh->FormatFlags = le32_to_cpu(mh->FormatFlags); |
140 | mh->PercentUsed = le32_to_cpu(mh->PercentUsed); | 140 | mh->PercentUsed = le32_to_cpu(mh->PercentUsed); |
141 | 141 | ||
142 | #ifdef CONFIG_MTD_DEBUG_VERBOSE | 142 | pr_debug("INFTL: Media Header ->\n" |
143 | if (CONFIG_MTD_DEBUG_VERBOSE >= 2) { | 143 | " bootRecordID = %s\n" |
144 | printk("INFTL: Media Header ->\n" | 144 | " NoOfBootImageBlocks = %d\n" |
145 | " bootRecordID = %s\n" | 145 | " NoOfBinaryPartitions = %d\n" |
146 | " NoOfBootImageBlocks = %d\n" | 146 | " NoOfBDTLPartitions = %d\n" |
147 | " NoOfBinaryPartitions = %d\n" | 147 | " BlockMultiplerBits = %d\n" |
148 | " NoOfBDTLPartitions = %d\n" | 148 | " FormatFlgs = %d\n" |
149 | " BlockMultiplerBits = %d\n" | 149 | " OsakVersion = 0x%x\n" |
150 | " FormatFlgs = %d\n" | 150 | " PercentUsed = %d\n", |
151 | " OsakVersion = 0x%x\n" | 151 | mh->bootRecordID, mh->NoOfBootImageBlocks, |
152 | " PercentUsed = %d\n", | 152 | mh->NoOfBinaryPartitions, |
153 | mh->bootRecordID, mh->NoOfBootImageBlocks, | 153 | mh->NoOfBDTLPartitions, |
154 | mh->NoOfBinaryPartitions, | 154 | mh->BlockMultiplierBits, mh->FormatFlags, |
155 | mh->NoOfBDTLPartitions, | 155 | mh->OsakVersion, mh->PercentUsed); |
156 | mh->BlockMultiplierBits, mh->FormatFlags, | ||
157 | mh->OsakVersion, mh->PercentUsed); | ||
158 | } | ||
159 | #endif | ||
160 | 156 | ||
161 | if (mh->NoOfBDTLPartitions == 0) { | 157 | if (mh->NoOfBDTLPartitions == 0) { |
162 | printk(KERN_WARNING "INFTL: Media Header sanity check " | 158 | printk(KERN_WARNING "INFTL: Media Header sanity check " |
@@ -200,19 +196,15 @@ static int find_boot_record(struct INFTLrecord *inftl) | |||
200 | ip->spareUnits = le32_to_cpu(ip->spareUnits); | 196 | ip->spareUnits = le32_to_cpu(ip->spareUnits); |
201 | ip->Reserved0 = le32_to_cpu(ip->Reserved0); | 197 | ip->Reserved0 = le32_to_cpu(ip->Reserved0); |
202 | 198 | ||
203 | #ifdef CONFIG_MTD_DEBUG_VERBOSE | 199 | pr_debug(" PARTITION[%d] ->\n" |
204 | if (CONFIG_MTD_DEBUG_VERBOSE >= 2) { | 200 | " virtualUnits = %d\n" |
205 | printk(" PARTITION[%d] ->\n" | 201 | " firstUnit = %d\n" |
206 | " virtualUnits = %d\n" | 202 | " lastUnit = %d\n" |
207 | " firstUnit = %d\n" | 203 | " flags = 0x%x\n" |
208 | " lastUnit = %d\n" | 204 | " spareUnits = %d\n", |
209 | " flags = 0x%x\n" | 205 | i, ip->virtualUnits, ip->firstUnit, |
210 | " spareUnits = %d\n", | 206 | ip->lastUnit, ip->flags, |
211 | i, ip->virtualUnits, ip->firstUnit, | 207 | ip->spareUnits); |
212 | ip->lastUnit, ip->flags, | ||
213 | ip->spareUnits); | ||
214 | } | ||
215 | #endif | ||
216 | 208 | ||
217 | if (ip->Reserved0 != ip->firstUnit) { | 209 | if (ip->Reserved0 != ip->firstUnit) { |
218 | struct erase_info *instr = &inftl->instr; | 210 | struct erase_info *instr = &inftl->instr; |
@@ -475,30 +467,30 @@ void INFTL_dumptables(struct INFTLrecord *s) | |||
475 | { | 467 | { |
476 | int i; | 468 | int i; |
477 | 469 | ||
478 | printk("-------------------------------------------" | 470 | pr_debug("-------------------------------------------" |
479 | "----------------------------------\n"); | 471 | "----------------------------------\n"); |
480 | 472 | ||
481 | printk("VUtable[%d] ->", s->nb_blocks); | 473 | pr_debug("VUtable[%d] ->", s->nb_blocks); |
482 | for (i = 0; i < s->nb_blocks; i++) { | 474 | for (i = 0; i < s->nb_blocks; i++) { |
483 | if ((i % 8) == 0) | 475 | if ((i % 8) == 0) |
484 | printk("\n%04x: ", i); | 476 | pr_debug("\n%04x: ", i); |
485 | printk("%04x ", s->VUtable[i]); | 477 | pr_debug("%04x ", s->VUtable[i]); |
486 | } | 478 | } |
487 | 479 | ||
488 | printk("\n-------------------------------------------" | 480 | pr_debug("\n-------------------------------------------" |
489 | "----------------------------------\n"); | 481 | "----------------------------------\n"); |
490 | 482 | ||
491 | printk("PUtable[%d-%d=%d] ->", s->firstEUN, s->lastEUN, s->nb_blocks); | 483 | pr_debug("PUtable[%d-%d=%d] ->", s->firstEUN, s->lastEUN, s->nb_blocks); |
492 | for (i = 0; i <= s->lastEUN; i++) { | 484 | for (i = 0; i <= s->lastEUN; i++) { |
493 | if ((i % 8) == 0) | 485 | if ((i % 8) == 0) |
494 | printk("\n%04x: ", i); | 486 | pr_debug("\n%04x: ", i); |
495 | printk("%04x ", s->PUtable[i]); | 487 | pr_debug("%04x ", s->PUtable[i]); |
496 | } | 488 | } |
497 | 489 | ||
498 | printk("\n-------------------------------------------" | 490 | pr_debug("\n-------------------------------------------" |
499 | "----------------------------------\n"); | 491 | "----------------------------------\n"); |
500 | 492 | ||
501 | printk("INFTL ->\n" | 493 | pr_debug("INFTL ->\n" |
502 | " EraseSize = %d\n" | 494 | " EraseSize = %d\n" |
503 | " h/s/c = %d/%d/%d\n" | 495 | " h/s/c = %d/%d/%d\n" |
504 | " numvunits = %d\n" | 496 | " numvunits = %d\n" |
@@ -512,7 +504,7 @@ void INFTL_dumptables(struct INFTLrecord *s) | |||
512 | s->numvunits, s->firstEUN, s->lastEUN, s->numfreeEUNs, | 504 | s->numvunits, s->firstEUN, s->lastEUN, s->numfreeEUNs, |
513 | s->LastFreeEUN, s->nb_blocks, s->nb_boot_blocks); | 505 | s->LastFreeEUN, s->nb_blocks, s->nb_boot_blocks); |
514 | 506 | ||
515 | printk("\n-------------------------------------------" | 507 | pr_debug("\n-------------------------------------------" |
516 | "----------------------------------\n"); | 508 | "----------------------------------\n"); |
517 | } | 509 | } |
518 | 510 | ||
@@ -520,25 +512,25 @@ void INFTL_dumpVUchains(struct INFTLrecord *s) | |||
520 | { | 512 | { |
521 | int logical, block, i; | 513 | int logical, block, i; |
522 | 514 | ||
523 | printk("-------------------------------------------" | 515 | pr_debug("-------------------------------------------" |
524 | "----------------------------------\n"); | 516 | "----------------------------------\n"); |
525 | 517 | ||
526 | printk("INFTL Virtual Unit Chains:\n"); | 518 | pr_debug("INFTL Virtual Unit Chains:\n"); |
527 | for (logical = 0; logical < s->nb_blocks; logical++) { | 519 | for (logical = 0; logical < s->nb_blocks; logical++) { |
528 | block = s->VUtable[logical]; | 520 | block = s->VUtable[logical]; |
529 | if (block > s->nb_blocks) | 521 | if (block > s->nb_blocks) |
530 | continue; | 522 | continue; |
531 | printk(" LOGICAL %d --> %d ", logical, block); | 523 | pr_debug(" LOGICAL %d --> %d ", logical, block); |
532 | for (i = 0; i < s->nb_blocks; i++) { | 524 | for (i = 0; i < s->nb_blocks; i++) { |
533 | if (s->PUtable[block] == BLOCK_NIL) | 525 | if (s->PUtable[block] == BLOCK_NIL) |
534 | break; | 526 | break; |
535 | block = s->PUtable[block]; | 527 | block = s->PUtable[block]; |
536 | printk("%d ", block); | 528 | pr_debug("%d ", block); |
537 | } | 529 | } |
538 | printk("\n"); | 530 | pr_debug("\n"); |
539 | } | 531 | } |
540 | 532 | ||
541 | printk("-------------------------------------------" | 533 | pr_debug("-------------------------------------------" |
542 | "----------------------------------\n"); | 534 | "----------------------------------\n"); |
543 | } | 535 | } |
544 | 536 | ||
@@ -716,10 +708,7 @@ int INFTL_mount(struct INFTLrecord *s) | |||
716 | logical_block = BLOCK_NIL; | 708 | logical_block = BLOCK_NIL; |
717 | } | 709 | } |
718 | 710 | ||
719 | #ifdef CONFIG_MTD_DEBUG_VERBOSE | 711 | INFTL_dumptables(s); |
720 | if (CONFIG_MTD_DEBUG_VERBOSE >= 2) | ||
721 | INFTL_dumptables(s); | ||
722 | #endif | ||
723 | 712 | ||
724 | /* | 713 | /* |
725 | * Second pass, check for infinite loops in chains. These are | 714 | * Second pass, check for infinite loops in chains. These are |
@@ -771,12 +760,8 @@ int INFTL_mount(struct INFTLrecord *s) | |||
771 | } | 760 | } |
772 | } | 761 | } |
773 | 762 | ||
774 | #ifdef CONFIG_MTD_DEBUG_VERBOSE | 763 | INFTL_dumptables(s); |
775 | if (CONFIG_MTD_DEBUG_VERBOSE >= 2) | 764 | INFTL_dumpVUchains(s); |
776 | INFTL_dumptables(s); | ||
777 | if (CONFIG_MTD_DEBUG_VERBOSE >= 2) | ||
778 | INFTL_dumpVUchains(s); | ||
779 | #endif | ||
780 | 765 | ||
781 | /* | 766 | /* |
782 | * Third pass, format unreferenced blocks and init free block count. | 767 | * Third pass, format unreferenced blocks and init free block count. |
diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c index afa9bd81220..e8e9fec2355 100644 --- a/drivers/mtd/maps/pcmciamtd.c +++ b/drivers/mtd/maps/pcmciamtd.c | |||
@@ -321,7 +321,6 @@ static void pcmciamtd_release(struct pcmcia_device *link) | |||
321 | } | 321 | } |
322 | 322 | ||
323 | 323 | ||
324 | #ifdef CONFIG_MTD_DEBUG | ||
325 | static int pcmciamtd_cistpl_format(struct pcmcia_device *p_dev, | 324 | static int pcmciamtd_cistpl_format(struct pcmcia_device *p_dev, |
326 | tuple_t *tuple, | 325 | tuple_t *tuple, |
327 | void *priv_data) | 326 | void *priv_data) |
@@ -352,7 +351,6 @@ static int pcmciamtd_cistpl_jedec(struct pcmcia_device *p_dev, | |||
352 | } | 351 | } |
353 | return -ENOSPC; | 352 | return -ENOSPC; |
354 | } | 353 | } |
355 | #endif | ||
356 | 354 | ||
357 | static int pcmciamtd_cistpl_device(struct pcmcia_device *p_dev, | 355 | static int pcmciamtd_cistpl_device(struct pcmcia_device *p_dev, |
358 | tuple_t *tuple, | 356 | tuple_t *tuple, |
@@ -419,10 +417,8 @@ static void card_settings(struct pcmciamtd_dev *dev, struct pcmcia_device *p_dev | |||
419 | pr_debug("Found name: %s\n", dev->mtd_name); | 417 | pr_debug("Found name: %s\n", dev->mtd_name); |
420 | } | 418 | } |
421 | 419 | ||
422 | #ifdef CONFIG_MTD_DEBUG | ||
423 | pcmcia_loop_tuple(p_dev, CISTPL_FORMAT, pcmciamtd_cistpl_format, NULL); | 420 | pcmcia_loop_tuple(p_dev, CISTPL_FORMAT, pcmciamtd_cistpl_format, NULL); |
424 | pcmcia_loop_tuple(p_dev, CISTPL_JEDEC_C, pcmciamtd_cistpl_jedec, NULL); | 421 | pcmcia_loop_tuple(p_dev, CISTPL_JEDEC_C, pcmciamtd_cistpl_jedec, NULL); |
425 | #endif | ||
426 | pcmcia_loop_tuple(p_dev, CISTPL_DEVICE, pcmciamtd_cistpl_device, dev); | 422 | pcmcia_loop_tuple(p_dev, CISTPL_DEVICE, pcmciamtd_cistpl_device, dev); |
427 | pcmcia_loop_tuple(p_dev, CISTPL_DEVICE_GEO, pcmciamtd_cistpl_geo, dev); | 423 | pcmcia_loop_tuple(p_dev, CISTPL_DEVICE_GEO, pcmciamtd_cistpl_geo, dev); |
428 | 424 | ||