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

Staging: pata_rdc: remove dbgprintf macro

Use dev_dbg() instead.

Cc: Kevin Huang <Kevin.Huang@rdc.com.tw>
Cc: Tomy Wang <Tomy.Wang@rdc.com.tw>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

+38 -44
+38 -44
drivers/staging/pata_rdc/pata_rdc.c
··· 10 10 11 11 #include "pata_rdc.h" 12 12 13 - /* #define DBGPRINTF */ 14 - 15 - #ifdef DBGPRINTF 16 - 17 - #define dbgprintf(format, arg...) printk(KERN_INFO format, ## arg) 18 - 19 - #else 20 - 21 - #define dbgprintf(...) 22 - 23 - #endif 24 - 25 13 /* Driver Info. */ 26 14 #define DRIVER_NAME "pata_rdc" /* sata_rdc for SATA */ 27 15 #define DRIVER_VERSION "2.6.28" /* based on kernel version. */ ··· 648 660 uint Channel; 649 661 650 662 Channel = ap->port_no; 651 - dbgprintf("rdc_pata_port_start Channel: %u \n", Channel); 663 + dev_dbg(ap->dev, "%s: Channel: %u\n", __func__, Channel); 652 664 if (ap->ioaddr.bmdma_addr) { 653 665 return ata_port_start(ap); 654 666 } else { 655 - dbgprintf("rdc_pata_port_start return 0 !!!\n"); 667 + dev_dbg(ap->dev, "%s: return 0!!!\n", __func__); 656 668 return 0; 657 669 } 658 670 } ··· 663 675 664 676 Channel = ap->port_no; 665 677 666 - dbgprintf("rdc_pata_port_stop Channel: %u \n", Channel); 678 + dev_dbg(ap->dev, "%s Channel: %u\n", __func__, Channel); 667 679 } 668 680 669 681 /** ··· 680 692 struct ata_port *ap; 681 693 uint Channel; 682 694 683 - dbgprintf("rdc_pata_prereset\n"); 695 + dev_dbg(link->ap->dev, "%s\n", __func__); 684 696 685 697 ap = link->ap; 686 698 pdev = to_pci_dev(ap->host->dev); ··· 689 701 690 702 /* test ATA Decode Enable Bits, should be enable. */ 691 703 if (!pci_test_config_bits(pdev, &ATA_Decode_Enable_Bits[Channel])) { 692 - dbgprintf("rdc_pata_prereset Channel: %u, Decode Disable\n", Channel); 704 + dev_dbg(link->ap->dev, "%s: Channel: %u, Decode Disable\n", 705 + __func__, Channel); 693 706 return -ENOENT; 694 707 } else { 695 - dbgprintf("rdc_pata_prereset Channel: %u, Decode Enable\n", Channel); 708 + dev_dbg(link->ap->dev, "%s: Channel: %u, Decode Enable\n", 709 + __func__, Channel); 696 710 return ata_std_prereset(link, deadline); 697 711 } 698 712 } ··· 716 726 uint Mask; 717 727 u32 u32Value; 718 728 719 - dbgprintf("rdc_pata_cable_detect\n"); 729 + dev_dbg(ap->dev, "%s\n", __func__); 720 730 721 731 pdev = to_pci_dev(ap->host->dev); 722 732 ··· 731 741 pci_read_config_dword(pdev, ATAConfiguration_ID_IDEIOConfiguration + ATAConfiguration_PCIOffset, &u32Value); 732 742 733 743 if ((u32Value & Mask) == 0) { 734 - dbgprintf("rdc_pata_cable_detect Channel: %u, PATA40 \n", Channel); 744 + dev_dbg(ap->dev, "%s: Channel: %u, PATA40 \n", 745 + __func__, Channel); 735 746 return ATA_CBL_PATA40; 736 747 } else { 737 - dbgprintf("rdc_pata_cable_detect Channel: %u, PATA80 \n", Channel); 748 + dev_dbg(ap->dev, "%s: Channel: %u, PATA80 \n", 749 + __func__, Channel); 738 750 return ATA_CBL_PATA80; 739 751 } 740 752 } ··· 759 767 uint PIOTimingMode; 760 768 uint PrefetchPostingEnable; 761 769 762 - dbgprintf("rdc_pata_set_piomode\n"); 770 + dev_dbg(ap->dev, "%s\n", __func__); 763 771 764 772 pdev = to_pci_dev(ap->host->dev); 765 773 ··· 817 825 UDMA0 818 826 ); 819 827 } 820 - dbgprintf("rdc_pata_set_piomode Channel: %u, DeviceID: %u, PIO: %d \n", Channel, DeviceID, PIOTimingMode); 828 + dev_dbg(ap->dev, "%s: Channel: %u, DeviceID: %u, PIO: %d\n", 829 + __func__, Channel, DeviceID, PIOTimingMode); 821 830 } 822 831 823 832 /** ··· 841 848 uint DMATimingMode; 842 849 uint UDMAEnable; 843 850 844 - dbgprintf("rdc_pata_set_dmamode\n"); 851 + dev_dbg(ap->dev, "%s\n", __func__); 845 852 846 853 pdev = to_pci_dev(ap->host->dev); 847 854 ··· 880 887 DeviceID, 881 888 UDMAEnable, 882 889 DMATimingMode - XFER_UDMA_0); 883 - dbgprintf("rdc_pata_set_dmamode Channel: %u, DeviceID: %u, UDMA: %u \n", Channel, DeviceID, (uint)(DMATimingMode - XFER_UDMA_0)); 890 + dev_dbg(ap->dev, 891 + "%s: Channel: %u, DeviceID: %u, UDMA: %u\n", 892 + __func__, Channel, DeviceID, 893 + (uint)(DMATimingMode - XFER_UDMA_0)); 884 894 } else { 885 895 /* MDMA */ 886 896 ATAHostAdapter_SetPrimaryPIO(pdev, ··· 896 900 DeviceID, 897 901 FALSE,/*UDMAEnable,*/ 898 902 UDMA0); 899 - dbgprintf("rdc_pata_set_dmamode Channel: %u, DeviceID: %u, MDMA: %u \n", Channel, DeviceID, (uint)(DMATimingMode - XFER_MW_DMA_0)); 903 + dev_dbg(ap->dev, 904 + "%s: Channel: %u, DeviceID: %u, MDMA: %u\n", 905 + __func__, Channel, DeviceID, 906 + (uint)(DMATimingMode - XFER_MW_DMA_0)); 900 907 } 901 908 } else { 902 909 if (DMATimingMode >= XFER_UDMA_0) { ··· 914 915 DeviceID, 915 916 UDMAEnable, 916 917 DMATimingMode - XFER_UDMA_0); 917 - dbgprintf("rdc_pata_set_dmamode Channel: %u, DeviceID: %u, UDMA: %u \n", Channel, DeviceID, (uint)(DMATimingMode - XFER_UDMA_0)); 918 + dev_dbg(ap->dev, 919 + "%s: Channel: %u, DeviceID: %u, UDMA: %u\n", 920 + __func__, Channel, DeviceID, 921 + (uint)(DMATimingMode - XFER_UDMA_0)); 918 922 } else { 919 923 /* MDMA */ 920 924 ATAHostAdapter_SetSecondaryPIO(pdev, ··· 930 928 DeviceID, 931 929 FALSE,/*UDMAEnable,*/ 932 930 UDMA0); 933 - dbgprintf("rdc_pata_set_dmamode Channel: %u, DeviceID: %u, MDMA: %u \n", Channel, DeviceID, (uint)(DMATimingMode - XFER_MW_DMA_0)); 931 + dev_dbg(ap->dev, 932 + "%s: Channel: %u, DeviceID: %u, MDMA: %u \n", 933 + __func__, Channel, DeviceID, 934 + (uint)(DMATimingMode - XFER_MW_DMA_0)); 934 935 } 935 936 } 936 937 } ··· 975 970 static int __devinit rdc_init_one(struct pci_dev *pdev, 976 971 const struct pci_device_id *ent) 977 972 { 978 - /*struct device *dev = &pdev->dev; */ 979 973 struct ata_port_info port_info[2]; 980 974 const struct ata_port_info *ppinfo[] = { &port_info[0], &port_info[1] }; 981 975 982 976 int rc; 983 977 984 - dbgprintf("rdc_init_one\n"); 978 + dev_dbg(&pdev->dev, "%s\n", __func__); 985 979 986 980 port_info[0] = rdc_pata_port_info[ent->driver_data]; 987 981 port_info[1] = rdc_pata_port_info[ent->driver_data]; ··· 988 984 /* enable device and prepare host */ 989 985 rc = pci_enable_device(pdev); 990 986 if (rc) { 991 - dbgprintf("rdc_init_one pci_enable_device failed \n"); 987 + dev_dbg(&pdev->dev, "%s pci_enable_device failed\n", __func__); 992 988 return rc; 993 989 } 994 - /* initialize controller */ 995 990 996 - pci_intx(pdev, 1); /* enable interrupt */ 991 + /* enable interrupt */ 992 + pci_intx(pdev, 1); 997 993 998 994 return ata_pci_sff_init_one(pdev, ppinfo, &rdc_pata_sht, NULL); 999 995 } ··· 1012 1008 1013 1009 static int __init pata_rdc_init(void) 1014 1010 { 1015 - int rc; 1016 - 1017 - dbgprintf("pata_rdc_init\n"); 1018 - rc = pci_register_driver(&rdc_pata_driver); 1019 - if (rc) { 1020 - dbgprintf("pata_rdc_init faile\n"); 1021 - return rc; 1022 - } 1023 - 1024 - return 0; 1011 + return pci_register_driver(&rdc_pata_driver); 1025 1012 } 1026 1013 1027 1014 static void __exit pata_rdc_exit(void) 1028 1015 { 1029 - dbgprintf("pata_rdc_exit\n"); 1030 1016 pci_unregister_driver(&rdc_pata_driver); 1031 1017 } 1032 1018