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