Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ata: pata_pdc2027x: Replace PDPRINTK() with standard ata logging

Use standard ata logging macros instead of the hand-crafted
PDPRINTK and remove duplicate logging messages.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>

authored by

Hannes Reinecke and committed by
Damien Le Moal
b5a5fc8b 1891b92a

+28 -43
+28 -43
drivers/ata/pata_pdc2027x.c
··· 30 30 31 31 #define DRV_NAME "pata_pdc2027x" 32 32 #define DRV_VERSION "1.0" 33 - #undef PDC_DEBUG 34 - 35 - #ifdef PDC_DEBUG 36 - #define PDPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args) 37 - #else 38 - #define PDPRINTK(fmt, args...) 39 - #endif 40 33 41 34 enum { 42 35 PDC_MMIO_BAR = 5, ··· 207 214 if (cgcr & (1 << 26)) 208 215 goto cbl40; 209 216 210 - PDPRINTK("No cable or 80-conductor cable on port %d\n", ap->port_no); 217 + ata_port_dbg(ap, "No cable or 80-conductor cable\n"); 211 218 212 219 return ATA_CBL_PATA80; 213 220 cbl40: 214 - printk(KERN_INFO DRV_NAME ": 40-conductor cable detected on port %d\n", ap->port_no); 221 + ata_port_info(ap, DRV_NAME ":40-conductor cable detected\n"); 215 222 return ATA_CBL_PATA40; 216 223 } 217 224 ··· 285 292 unsigned int pio = adev->pio_mode - XFER_PIO_0; 286 293 u32 ctcr0, ctcr1; 287 294 288 - PDPRINTK("adev->pio_mode[%X]\n", adev->pio_mode); 295 + ata_port_dbg(ap, "adev->pio_mode[%X]\n", adev->pio_mode); 289 296 290 297 /* Sanity check */ 291 298 if (pio > 4) { 292 - printk(KERN_ERR DRV_NAME ": Unknown pio mode [%d] ignored\n", pio); 299 + ata_port_err(ap, "Unknown pio mode [%d] ignored\n", pio); 293 300 return; 294 301 295 302 } 296 303 297 304 /* Set the PIO timing registers using value table for 133MHz */ 298 - PDPRINTK("Set pio regs... \n"); 305 + ata_port_dbg(ap, "Set pio regs... \n"); 299 306 300 307 ctcr0 = ioread32(dev_mmio(ap, adev, PDC_CTCR0)); 301 308 ctcr0 &= 0xffff0000; ··· 308 315 ctcr1 |= (pdc2027x_pio_timing_tbl[pio].value2 << 24); 309 316 iowrite32(ctcr1, dev_mmio(ap, adev, PDC_CTCR1)); 310 317 311 - PDPRINTK("Set pio regs done\n"); 312 - 313 - PDPRINTK("Set to pio mode[%u] \n", pio); 318 + ata_port_dbg(ap, "Set to pio mode[%u] \n", pio); 314 319 } 315 320 316 321 /** ··· 341 350 iowrite32(ctcr1 & ~(1 << 7), dev_mmio(ap, adev, PDC_CTCR1)); 342 351 } 343 352 344 - PDPRINTK("Set udma regs... \n"); 353 + ata_port_dbg(ap, "Set udma regs... \n"); 345 354 346 355 ctcr1 = ioread32(dev_mmio(ap, adev, PDC_CTCR1)); 347 356 ctcr1 &= 0xff000000; ··· 350 359 (pdc2027x_udma_timing_tbl[udma_mode].value2 << 16); 351 360 iowrite32(ctcr1, dev_mmio(ap, adev, PDC_CTCR1)); 352 361 353 - PDPRINTK("Set udma regs done\n"); 354 - 355 - PDPRINTK("Set to udma mode[%u] \n", udma_mode); 362 + ata_port_dbg(ap, "Set to udma mode[%u] \n", udma_mode); 356 363 357 364 } else if ((dma_mode >= XFER_MW_DMA_0) && 358 365 (dma_mode <= XFER_MW_DMA_2)) { 359 366 /* Set the MDMA timing registers with value table for 133MHz */ 360 367 unsigned int mdma_mode = dma_mode & 0x07; 361 368 362 - PDPRINTK("Set mdma regs... \n"); 369 + ata_port_dbg(ap, "Set mdma regs... \n"); 363 370 ctcr0 = ioread32(dev_mmio(ap, adev, PDC_CTCR0)); 364 371 365 372 ctcr0 &= 0x0000ffff; ··· 365 376 (pdc2027x_mdma_timing_tbl[mdma_mode].value1 << 24); 366 377 367 378 iowrite32(ctcr0, dev_mmio(ap, adev, PDC_CTCR0)); 368 - PDPRINTK("Set mdma regs done\n"); 369 379 370 - PDPRINTK("Set to mdma mode[%u] \n", mdma_mode); 380 + ata_port_dbg(ap, "Set to mdma mode[%u] \n", mdma_mode); 371 381 } else { 372 - printk(KERN_ERR DRV_NAME ": Unknown dma mode [%u] ignored\n", dma_mode); 382 + ata_port_err(ap, "Unknown dma mode [%u] ignored\n", dma_mode); 373 383 } 374 384 } 375 385 ··· 402 414 ctcr1 |= (1 << 25); 403 415 iowrite32(ctcr1, dev_mmio(ap, dev, PDC_CTCR1)); 404 416 405 - PDPRINTK("Turn on prefetch\n"); 417 + ata_dev_dbg(dev, "Turn on prefetch\n"); 406 418 } else { 407 419 pdc2027x_set_dmamode(ap, dev); 408 420 } ··· 473 485 474 486 counter = (bccrh << 15) | bccrl; 475 487 476 - PDPRINTK("bccrh [%X] bccrl [%X]\n", bccrh, bccrl); 477 - PDPRINTK("bccrhv[%X] bccrlv[%X]\n", bccrhv, bccrlv); 488 + dev_dbg(host->dev, "bccrh [%X] bccrl [%X]\n", bccrh, bccrl); 489 + dev_dbg(host->dev, "bccrhv[%X] bccrlv[%X]\n", bccrhv, bccrlv); 478 490 479 491 /* 480 492 * The 30-bit decreasing counter are read by 2 pieces. ··· 483 495 */ 484 496 if (retry && !(bccrh == bccrhv && bccrl >= bccrlv)) { 485 497 retry--; 486 - PDPRINTK("rereading counter\n"); 498 + dev_dbg(host->dev, "rereading counter\n"); 487 499 goto retry; 488 500 } 489 501 ··· 508 520 509 521 /* Sanity check */ 510 522 if (unlikely(pll_clock_khz < 5000L || pll_clock_khz > 70000L)) { 511 - printk(KERN_ERR DRV_NAME ": Invalid PLL input clock %ldkHz, give up!\n", pll_clock_khz); 523 + dev_err(host->dev, "Invalid PLL input clock %ldkHz, give up!\n", 524 + pll_clock_khz); 512 525 return; 513 526 } 514 527 515 - #ifdef PDC_DEBUG 516 - PDPRINTK("pout_required is %ld\n", pout_required); 528 + dev_dbg(host->dev, "pout_required is %ld\n", pout_required); 517 529 518 530 /* Show the current clock value of PLL control register 519 531 * (maybe already configured by the firmware) 520 532 */ 521 533 pll_ctl = ioread16(mmio_base + PDC_PLL_CTL); 522 534 523 - PDPRINTK("pll_ctl[%X]\n", pll_ctl); 524 - #endif 535 + dev_dbg(host->dev, "pll_ctl[%X]\n", pll_ctl); 525 536 526 537 /* 527 538 * Calculate the ratio of F, R and OD ··· 539 552 R = 0x00; 540 553 } else { 541 554 /* Invalid ratio */ 542 - printk(KERN_ERR DRV_NAME ": Invalid ratio %ld, give up!\n", ratio); 555 + dev_err(host->dev, "Invalid ratio %ld, give up!\n", ratio); 543 556 return; 544 557 } 545 558 ··· 547 560 548 561 if (unlikely(F < 0 || F > 127)) { 549 562 /* Invalid F */ 550 - printk(KERN_ERR DRV_NAME ": F[%d] invalid!\n", F); 563 + dev_err(host->dev, "F[%d] invalid!\n", F); 551 564 return; 552 565 } 553 566 554 - PDPRINTK("F[%d] R[%d] ratio*1000[%ld]\n", F, R, ratio); 567 + dev_dbg(host->dev, "F[%d] R[%d] ratio*1000[%ld]\n", F, R, ratio); 555 568 556 569 pll_ctl = (R << 8) | F; 557 570 558 - PDPRINTK("Writing pll_ctl[%X]\n", pll_ctl); 571 + dev_dbg(host->dev, "Writing pll_ctl[%X]\n", pll_ctl); 559 572 560 573 iowrite16(pll_ctl, mmio_base + PDC_PLL_CTL); 561 574 ioread16(mmio_base + PDC_PLL_CTL); /* flush */ ··· 563 576 /* Wait the PLL circuit to be stable */ 564 577 msleep(30); 565 578 566 - #ifdef PDC_DEBUG 567 579 /* 568 580 * Show the current clock value of PLL control register 569 581 * (maybe configured by the firmware) 570 582 */ 571 583 pll_ctl = ioread16(mmio_base + PDC_PLL_CTL); 572 584 573 - PDPRINTK("pll_ctl[%X]\n", pll_ctl); 574 - #endif 585 + dev_dbg(host->dev, "pll_ctl[%X]\n", pll_ctl); 575 586 576 587 return; 577 588 } ··· 590 605 591 606 /* Start the test mode */ 592 607 scr = ioread32(mmio_base + PDC_SYS_CTL); 593 - PDPRINTK("scr[%X]\n", scr); 608 + dev_dbg(host->dev, "scr[%X]\n", scr); 594 609 iowrite32(scr | (0x01 << 14), mmio_base + PDC_SYS_CTL); 595 610 ioread32(mmio_base + PDC_SYS_CTL); /* flush */ 596 611 ··· 607 622 608 623 /* Stop the test mode */ 609 624 scr = ioread32(mmio_base + PDC_SYS_CTL); 610 - PDPRINTK("scr[%X]\n", scr); 625 + dev_dbg(host->dev, "scr[%X]\n", scr); 611 626 iowrite32(scr & ~(0x01 << 14), mmio_base + PDC_SYS_CTL); 612 627 ioread32(mmio_base + PDC_SYS_CTL); /* flush */ 613 628 ··· 617 632 pll_clock = ((start_count - end_count) & 0x3fffffff) / 100 * 618 633 (100000000 / usec_elapsed); 619 634 620 - PDPRINTK("start[%ld] end[%ld] \n", start_count, end_count); 621 - PDPRINTK("PLL input clock[%ld]Hz\n", pll_clock); 635 + dev_dbg(host->dev, "start[%ld] end[%ld] PLL input clock[%ld]HZ\n", 636 + start_count, end_count, pll_clock); 622 637 623 638 return pll_clock; 624 639 }