aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nftlcore.c
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2011-07-19 13:06:09 -0400
committerArtem Bityutskiy <artem.bityutskiy@intel.com>2011-09-11 08:02:16 -0400
commit289c05222172b51401dbbb017115655f241d94ab (patch)
tree1fd2c801102a8c4a085f75a08c766d3250491962 /drivers/mtd/nftlcore.c
parentd037021953922ebdbc34b98b8c4648017b1c6e89 (diff)
mtd: replace DEBUG() with pr_debug()
Start moving away from the MTD_DEBUG_LEVEL messages. The dynamic debugging feature is a generic kernel feature that provides more flexibility. (See Documentation/dynamic-debug-howto.txt) Also fix some punctuation, indentation, and capitalization that went along with the affected lines. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Diffstat (limited to 'drivers/mtd/nftlcore.c')
-rw-r--r--drivers/mtd/nftlcore.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/mtd/nftlcore.c b/drivers/mtd/nftlcore.c
index f3b3239746c8..93d6fc68b892 100644
--- a/drivers/mtd/nftlcore.c
+++ b/drivers/mtd/nftlcore.c
@@ -63,7 +63,7 @@ static void nftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
63 return; 63 return;
64 } 64 }
65 65
66 DEBUG(MTD_DEBUG_LEVEL1, "NFTL: add_mtd for %s\n", mtd->name); 66 pr_debug("NFTL: add_mtd for %s\n", mtd->name);
67 67
68 nftl = kzalloc(sizeof(struct NFTLrecord), GFP_KERNEL); 68 nftl = kzalloc(sizeof(struct NFTLrecord), GFP_KERNEL);
69 69
@@ -130,7 +130,7 @@ static void nftl_remove_dev(struct mtd_blktrans_dev *dev)
130{ 130{
131 struct NFTLrecord *nftl = (void *)dev; 131 struct NFTLrecord *nftl = (void *)dev;
132 132
133 DEBUG(MTD_DEBUG_LEVEL1, "NFTL: remove_dev (i=%d)\n", dev->devnum); 133 pr_debug("NFTL: remove_dev (i=%d)\n", dev->devnum);
134 134
135 del_mtd_blktrans_dev(dev); 135 del_mtd_blktrans_dev(dev);
136 kfree(nftl->ReplUnitTable); 136 kfree(nftl->ReplUnitTable);
@@ -218,7 +218,7 @@ static u16 NFTL_findfreeblock(struct NFTLrecord *nftl, int desperate )
218 218
219 /* Normally, we force a fold to happen before we run out of free blocks completely */ 219 /* Normally, we force a fold to happen before we run out of free blocks completely */
220 if (!desperate && nftl->numfreeEUNs < 2) { 220 if (!desperate && nftl->numfreeEUNs < 2) {
221 DEBUG(MTD_DEBUG_LEVEL1, "NFTL_findfreeblock: there are too few free EUNs\n"); 221 pr_debug("NFTL_findfreeblock: there are too few free EUNs\n");
222 return BLOCK_NIL; 222 return BLOCK_NIL;
223 } 223 }
224 224
@@ -289,8 +289,7 @@ static u16 NFTL_foldchain (struct NFTLrecord *nftl, unsigned thisVUC, unsigned p
289 if (block == 2) { 289 if (block == 2) {
290 foldmark = oob.u.c.FoldMark | oob.u.c.FoldMark1; 290 foldmark = oob.u.c.FoldMark | oob.u.c.FoldMark1;
291 if (foldmark == FOLD_MARK_IN_PROGRESS) { 291 if (foldmark == FOLD_MARK_IN_PROGRESS) {
292 DEBUG(MTD_DEBUG_LEVEL1, 292 pr_debug("Write Inhibited on EUN %d\n", thisEUN);
293 "Write Inhibited on EUN %d\n", thisEUN);
294 inplace = 0; 293 inplace = 0;
295 } else { 294 } else {
296 /* There's no other reason not to do inplace, 295 /* There's no other reason not to do inplace,
@@ -355,7 +354,7 @@ static u16 NFTL_foldchain (struct NFTLrecord *nftl, unsigned thisVUC, unsigned p
355 if (BlockLastState[block] != SECTOR_FREE && 354 if (BlockLastState[block] != SECTOR_FREE &&
356 BlockMap[block] != BLOCK_NIL && 355 BlockMap[block] != BLOCK_NIL &&
357 BlockMap[block] != targetEUN) { 356 BlockMap[block] != targetEUN) {
358 DEBUG(MTD_DEBUG_LEVEL1, "Setting inplace to 0. VUC %d, " 357 pr_debug("Setting inplace to 0. VUC %d, "
359 "block %d was %x lastEUN, " 358 "block %d was %x lastEUN, "
360 "and is in EUN %d (%s) %d\n", 359 "and is in EUN %d (%s) %d\n",
361 thisVUC, block, BlockLastState[block], 360 thisVUC, block, BlockLastState[block],
@@ -371,14 +370,14 @@ static u16 NFTL_foldchain (struct NFTLrecord *nftl, unsigned thisVUC, unsigned p
371 pendingblock < ((thisVUC + 1)* (nftl->EraseSize / 512)) && 370 pendingblock < ((thisVUC + 1)* (nftl->EraseSize / 512)) &&
372 BlockLastState[pendingblock - (thisVUC * (nftl->EraseSize / 512))] != 371 BlockLastState[pendingblock - (thisVUC * (nftl->EraseSize / 512))] !=
373 SECTOR_FREE) { 372 SECTOR_FREE) {
374 DEBUG(MTD_DEBUG_LEVEL1, "Pending write not free in EUN %d. " 373 pr_debug("Pending write not free in EUN %d. "
375 "Folding out of place.\n", targetEUN); 374 "Folding out of place.\n", targetEUN);
376 inplace = 0; 375 inplace = 0;
377 } 376 }
378 } 377 }
379 378
380 if (!inplace) { 379 if (!inplace) {
381 DEBUG(MTD_DEBUG_LEVEL1, "Cannot fold Virtual Unit Chain %d in place. " 380 pr_debug("Cannot fold Virtual Unit Chain %d in place. "
382 "Trying out-of-place\n", thisVUC); 381 "Trying out-of-place\n", thisVUC);
383 /* We need to find a targetEUN to fold into. */ 382 /* We need to find a targetEUN to fold into. */
384 targetEUN = NFTL_findfreeblock(nftl, 1); 383 targetEUN = NFTL_findfreeblock(nftl, 1);
@@ -408,7 +407,7 @@ static u16 NFTL_foldchain (struct NFTLrecord *nftl, unsigned thisVUC, unsigned p
408 and the Erase Unit into which we are supposed to be copying. 407 and the Erase Unit into which we are supposed to be copying.
409 Go for it. 408 Go for it.
410 */ 409 */
411 DEBUG(MTD_DEBUG_LEVEL1,"Folding chain %d into unit %d\n", thisVUC, targetEUN); 410 pr_debug("Folding chain %d into unit %d\n", thisVUC, targetEUN);
412 for (block = 0; block < nftl->EraseSize / 512 ; block++) { 411 for (block = 0; block < nftl->EraseSize / 512 ; block++) {
413 unsigned char movebuf[512]; 412 unsigned char movebuf[512];
414 int ret; 413 int ret;
@@ -455,7 +454,7 @@ static u16 NFTL_foldchain (struct NFTLrecord *nftl, unsigned thisVUC, unsigned p
455 has duplicate chains, we need to free one of the chains because it's not necessary any more. 454 has duplicate chains, we need to free one of the chains because it's not necessary any more.
456 */ 455 */
457 thisEUN = nftl->EUNtable[thisVUC]; 456 thisEUN = nftl->EUNtable[thisVUC];
458 DEBUG(MTD_DEBUG_LEVEL1,"Want to erase\n"); 457 pr_debug("Want to erase\n");
459 458
460 /* For each block in the old chain (except the targetEUN of course), 459 /* For each block in the old chain (except the targetEUN of course),
461 free it and make it available for future use */ 460 free it and make it available for future use */
@@ -568,7 +567,7 @@ static inline u16 NFTL_findwriteunit(struct NFTLrecord *nftl, unsigned block)
568 (writeEUN * nftl->EraseSize) + blockofs, 567 (writeEUN * nftl->EraseSize) + blockofs,
569 8, &retlen, (char *)&bci); 568 8, &retlen, (char *)&bci);
570 569
571 DEBUG(MTD_DEBUG_LEVEL2, "Status of block %d in EUN %d is %x\n", 570 pr_debug("Status of block %d in EUN %d is %x\n",
572 block , writeEUN, le16_to_cpu(bci.Status)); 571 block , writeEUN, le16_to_cpu(bci.Status));
573 572
574 status = bci.Status | bci.Status1; 573 status = bci.Status | bci.Status1;
@@ -621,7 +620,7 @@ static inline u16 NFTL_findwriteunit(struct NFTLrecord *nftl, unsigned block)
621 but they are reserved for when we're 620 but they are reserved for when we're
622 desperate. Well, now we're desperate. 621 desperate. Well, now we're desperate.
623 */ 622 */
624 DEBUG(MTD_DEBUG_LEVEL1, "Using desperate==1 to find free EUN to accommodate write to VUC %d\n", thisVUC); 623 pr_debug("Using desperate==1 to find free EUN to accommodate write to VUC %d\n", thisVUC);
625 writeEUN = NFTL_findfreeblock(nftl, 1); 624 writeEUN = NFTL_findfreeblock(nftl, 1);
626 } 625 }
627 if (writeEUN == BLOCK_NIL) { 626 if (writeEUN == BLOCK_NIL) {