diff options
author | Brian Norris <computersforpeace@gmail.com> | 2011-07-19 13:06:09 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-11 08:02:16 -0400 |
commit | 289c05222172b51401dbbb017115655f241d94ab (patch) | |
tree | 1fd2c801102a8c4a085f75a08c766d3250491962 /drivers/mtd/ssfdc.c | |
parent | d037021953922ebdbc34b98b8c4648017b1c6e89 (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/ssfdc.c')
-rw-r--r-- | drivers/mtd/ssfdc.c | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/drivers/mtd/ssfdc.c b/drivers/mtd/ssfdc.c index 00d1405af50b..5f917f0a9609 100644 --- a/drivers/mtd/ssfdc.c +++ b/drivers/mtd/ssfdc.c | |||
@@ -135,8 +135,7 @@ static int get_valid_cis_sector(struct mtd_info *mtd) | |||
135 | /* Found */ | 135 | /* Found */ |
136 | cis_sector = (int)(offset >> SECTOR_SHIFT); | 136 | cis_sector = (int)(offset >> SECTOR_SHIFT); |
137 | } else { | 137 | } else { |
138 | DEBUG(MTD_DEBUG_LEVEL1, | 138 | pr_debug("SSFDC_RO: CIS/IDI sector not found" |
139 | "SSFDC_RO: CIS/IDI sector not found" | ||
140 | " on %s (mtd%d)\n", mtd->name, | 139 | " on %s (mtd%d)\n", mtd->name, |
141 | mtd->index); | 140 | mtd->index); |
142 | } | 141 | } |
@@ -221,8 +220,7 @@ static int get_logical_address(uint8_t *oob_buf) | |||
221 | block_address >>= 1; | 220 | block_address >>= 1; |
222 | 221 | ||
223 | if (get_parity(block_address, 10) != parity) { | 222 | if (get_parity(block_address, 10) != parity) { |
224 | DEBUG(MTD_DEBUG_LEVEL0, | 223 | pr_debug("SSFDC_RO: logical address field%d" |
225 | "SSFDC_RO: logical address field%d" | ||
226 | "parity error(0x%04X)\n", j+1, | 224 | "parity error(0x%04X)\n", j+1, |
227 | block_address); | 225 | block_address); |
228 | } else { | 226 | } else { |
@@ -235,7 +233,7 @@ static int get_logical_address(uint8_t *oob_buf) | |||
235 | if (!ok) | 233 | if (!ok) |
236 | block_address = -2; | 234 | block_address = -2; |
237 | 235 | ||
238 | DEBUG(MTD_DEBUG_LEVEL3, "SSFDC_RO: get_logical_address() %d\n", | 236 | pr_debug("SSFDC_RO: get_logical_address() %d\n", |
239 | block_address); | 237 | block_address); |
240 | 238 | ||
241 | return block_address; | 239 | return block_address; |
@@ -249,7 +247,7 @@ static int build_logical_block_map(struct ssfdcr_record *ssfdc) | |||
249 | int ret, block_address, phys_block; | 247 | int ret, block_address, phys_block; |
250 | struct mtd_info *mtd = ssfdc->mbd.mtd; | 248 | struct mtd_info *mtd = ssfdc->mbd.mtd; |
251 | 249 | ||
252 | DEBUG(MTD_DEBUG_LEVEL1, "SSFDC_RO: build_block_map() nblks=%d (%luK)\n", | 250 | pr_debug("SSFDC_RO: build_block_map() nblks=%d (%luK)\n", |
253 | ssfdc->map_len, | 251 | ssfdc->map_len, |
254 | (unsigned long)ssfdc->map_len * ssfdc->erase_size / 1024); | 252 | (unsigned long)ssfdc->map_len * ssfdc->erase_size / 1024); |
255 | 253 | ||
@@ -262,8 +260,7 @@ static int build_logical_block_map(struct ssfdcr_record *ssfdc) | |||
262 | 260 | ||
263 | ret = read_raw_oob(mtd, offset, oob_buf); | 261 | ret = read_raw_oob(mtd, offset, oob_buf); |
264 | if (ret < 0) { | 262 | if (ret < 0) { |
265 | DEBUG(MTD_DEBUG_LEVEL0, | 263 | pr_debug("SSFDC_RO: mtd read_oob() failed at %lu\n", |
266 | "SSFDC_RO: mtd read_oob() failed at %lu\n", | ||
267 | offset); | 264 | offset); |
268 | return -1; | 265 | return -1; |
269 | } | 266 | } |
@@ -279,8 +276,7 @@ static int build_logical_block_map(struct ssfdcr_record *ssfdc) | |||
279 | ssfdc->logic_block_map[block_address] = | 276 | ssfdc->logic_block_map[block_address] = |
280 | (unsigned short)phys_block; | 277 | (unsigned short)phys_block; |
281 | 278 | ||
282 | DEBUG(MTD_DEBUG_LEVEL2, | 279 | pr_debug("SSFDC_RO: build_block_map() phys_block=%d," |
283 | "SSFDC_RO: build_block_map() phys_block=%d," | ||
284 | "logic_block_addr=%d, zone=%d\n", | 280 | "logic_block_addr=%d, zone=%d\n", |
285 | phys_block, block_address, zone_index); | 281 | phys_block, block_address, zone_index); |
286 | } | 282 | } |
@@ -316,8 +312,7 @@ static void ssfdcr_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) | |||
316 | ssfdc->erase_size = mtd->erasesize; | 312 | ssfdc->erase_size = mtd->erasesize; |
317 | ssfdc->map_len = (u32)mtd->size / mtd->erasesize; | 313 | ssfdc->map_len = (u32)mtd->size / mtd->erasesize; |
318 | 314 | ||
319 | DEBUG(MTD_DEBUG_LEVEL1, | 315 | pr_debug("SSFDC_RO: cis_block=%d,erase_size=%d,map_len=%d,n_zones=%d\n", |
320 | "SSFDC_RO: cis_block=%d,erase_size=%d,map_len=%d,n_zones=%d\n", | ||
321 | ssfdc->cis_block, ssfdc->erase_size, ssfdc->map_len, | 316 | ssfdc->cis_block, ssfdc->erase_size, ssfdc->map_len, |
322 | DIV_ROUND_UP(ssfdc->map_len, MAX_PHYS_BLK_PER_ZONE)); | 317 | DIV_ROUND_UP(ssfdc->map_len, MAX_PHYS_BLK_PER_ZONE)); |
323 | 318 | ||
@@ -328,7 +323,7 @@ static void ssfdcr_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) | |||
328 | ssfdc->cylinders = (unsigned short)(((u32)mtd->size >> SECTOR_SHIFT) / | 323 | ssfdc->cylinders = (unsigned short)(((u32)mtd->size >> SECTOR_SHIFT) / |
329 | ((long)ssfdc->sectors * (long)ssfdc->heads)); | 324 | ((long)ssfdc->sectors * (long)ssfdc->heads)); |
330 | 325 | ||
331 | DEBUG(MTD_DEBUG_LEVEL1, "SSFDC_RO: using C:%d H:%d S:%d == %ld sects\n", | 326 | pr_debug("SSFDC_RO: using C:%d H:%d S:%d == %ld sects\n", |
332 | ssfdc->cylinders, ssfdc->heads , ssfdc->sectors, | 327 | ssfdc->cylinders, ssfdc->heads , ssfdc->sectors, |
333 | (long)ssfdc->cylinders * (long)ssfdc->heads * | 328 | (long)ssfdc->cylinders * (long)ssfdc->heads * |
334 | (long)ssfdc->sectors); | 329 | (long)ssfdc->sectors); |
@@ -365,7 +360,7 @@ static void ssfdcr_remove_dev(struct mtd_blktrans_dev *dev) | |||
365 | { | 360 | { |
366 | struct ssfdcr_record *ssfdc = (struct ssfdcr_record *)dev; | 361 | struct ssfdcr_record *ssfdc = (struct ssfdcr_record *)dev; |
367 | 362 | ||
368 | DEBUG(MTD_DEBUG_LEVEL1, "SSFDC_RO: remove_dev (i=%d)\n", dev->devnum); | 363 | pr_debug("SSFDC_RO: remove_dev (i=%d)\n", dev->devnum); |
369 | 364 | ||
370 | del_mtd_blktrans_dev(dev); | 365 | del_mtd_blktrans_dev(dev); |
371 | kfree(ssfdc->logic_block_map); | 366 | kfree(ssfdc->logic_block_map); |
@@ -381,8 +376,7 @@ static int ssfdcr_readsect(struct mtd_blktrans_dev *dev, | |||
381 | offset = (int)(logic_sect_no % sectors_per_block); | 376 | offset = (int)(logic_sect_no % sectors_per_block); |
382 | block_address = (int)(logic_sect_no / sectors_per_block); | 377 | block_address = (int)(logic_sect_no / sectors_per_block); |
383 | 378 | ||
384 | DEBUG(MTD_DEBUG_LEVEL3, | 379 | pr_debug("SSFDC_RO: ssfdcr_readsect(%lu) sec_per_blk=%d, ofst=%d," |
385 | "SSFDC_RO: ssfdcr_readsect(%lu) sec_per_blk=%d, ofst=%d," | ||
386 | " block_addr=%d\n", logic_sect_no, sectors_per_block, offset, | 380 | " block_addr=%d\n", logic_sect_no, sectors_per_block, offset, |
387 | block_address); | 381 | block_address); |
388 | 382 | ||
@@ -391,8 +385,7 @@ static int ssfdcr_readsect(struct mtd_blktrans_dev *dev, | |||
391 | 385 | ||
392 | block_address = ssfdc->logic_block_map[block_address]; | 386 | block_address = ssfdc->logic_block_map[block_address]; |
393 | 387 | ||
394 | DEBUG(MTD_DEBUG_LEVEL3, | 388 | pr_debug("SSFDC_RO: ssfdcr_readsect() phys_block_addr=%d\n", |
395 | "SSFDC_RO: ssfdcr_readsect() phys_block_addr=%d\n", | ||
396 | block_address); | 389 | block_address); |
397 | 390 | ||
398 | if (block_address < 0xffff) { | 391 | if (block_address < 0xffff) { |
@@ -401,8 +394,7 @@ static int ssfdcr_readsect(struct mtd_blktrans_dev *dev, | |||
401 | sect_no = (unsigned long)block_address * sectors_per_block + | 394 | sect_no = (unsigned long)block_address * sectors_per_block + |
402 | offset; | 395 | offset; |
403 | 396 | ||
404 | DEBUG(MTD_DEBUG_LEVEL3, | 397 | pr_debug("SSFDC_RO: ssfdcr_readsect() phys_sect_no=%lu\n", |
405 | "SSFDC_RO: ssfdcr_readsect() phys_sect_no=%lu\n", | ||
406 | sect_no); | 398 | sect_no); |
407 | 399 | ||
408 | if (read_physical_sector(ssfdc->mbd.mtd, buf, sect_no) < 0) | 400 | if (read_physical_sector(ssfdc->mbd.mtd, buf, sect_no) < 0) |
@@ -418,7 +410,7 @@ static int ssfdcr_getgeo(struct mtd_blktrans_dev *dev, struct hd_geometry *geo) | |||
418 | { | 410 | { |
419 | struct ssfdcr_record *ssfdc = (struct ssfdcr_record *)dev; | 411 | struct ssfdcr_record *ssfdc = (struct ssfdcr_record *)dev; |
420 | 412 | ||
421 | DEBUG(MTD_DEBUG_LEVEL1, "SSFDC_RO: ssfdcr_getgeo() C=%d, H=%d, S=%d\n", | 413 | pr_debug("SSFDC_RO: ssfdcr_getgeo() C=%d, H=%d, S=%d\n", |
422 | ssfdc->cylinders, ssfdc->heads, ssfdc->sectors); | 414 | ssfdc->cylinders, ssfdc->heads, ssfdc->sectors); |
423 | 415 | ||
424 | geo->heads = ssfdc->heads; | 416 | geo->heads = ssfdc->heads; |