aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2010-03-03 12:17:43 -0500
committerJeff Garzik <jgarzik@redhat.com>2010-05-14 17:08:01 -0400
commit439fcaec10cef14a08557623d6f5fa240aaf3e2b (patch)
tree4ae5b932d4a23faf972c021ac444fd5fea3d4ea8
parent781d655083f8fb0a343bb694e83b96f04e934b4f (diff)
ahci: Factor out PCI specifics from ahci_print_info()
Introduce ahci_pci_print_info() that now handles PCI stuff. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r--drivers/ata/ahci.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index ac875c506740..a69e5b03429f 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -2845,15 +2845,12 @@ static int ahci_configure_dma_masks(struct pci_dev *pdev, int using_dac)
2845 return 0; 2845 return 0;
2846} 2846}
2847 2847
2848static void ahci_print_info(struct ata_host *host) 2848static void ahci_print_info(struct ata_host *host, const char *scc_s)
2849{ 2849{
2850 struct ahci_host_priv *hpriv = host->private_data; 2850 struct ahci_host_priv *hpriv = host->private_data;
2851 struct pci_dev *pdev = to_pci_dev(host->dev);
2852 void __iomem *mmio = hpriv->mmio; 2851 void __iomem *mmio = hpriv->mmio;
2853 u32 vers, cap, cap2, impl, speed; 2852 u32 vers, cap, cap2, impl, speed;
2854 const char *speed_s; 2853 const char *speed_s;
2855 u16 cc;
2856 const char *scc_s;
2857 2854
2858 vers = readl(mmio + HOST_VERSION); 2855 vers = readl(mmio + HOST_VERSION);
2859 cap = hpriv->cap; 2856 cap = hpriv->cap;
@@ -2870,17 +2867,7 @@ static void ahci_print_info(struct ata_host *host)
2870 else 2867 else
2871 speed_s = "?"; 2868 speed_s = "?";
2872 2869
2873 pci_read_config_word(pdev, 0x0a, &cc); 2870 dev_info(host->dev,
2874 if (cc == PCI_CLASS_STORAGE_IDE)
2875 scc_s = "IDE";
2876 else if (cc == PCI_CLASS_STORAGE_SATA)
2877 scc_s = "SATA";
2878 else if (cc == PCI_CLASS_STORAGE_RAID)
2879 scc_s = "RAID";
2880 else
2881 scc_s = "unknown";
2882
2883 dev_printk(KERN_INFO, &pdev->dev,
2884 "AHCI %02x%02x.%02x%02x " 2871 "AHCI %02x%02x.%02x%02x "
2885 "%u slots %u ports %s Gbps 0x%x impl %s mode\n" 2872 "%u slots %u ports %s Gbps 0x%x impl %s mode\n"
2886 , 2873 ,
@@ -2896,7 +2883,7 @@ static void ahci_print_info(struct ata_host *host)
2896 impl, 2883 impl,
2897 scc_s); 2884 scc_s);
2898 2885
2899 dev_printk(KERN_INFO, &pdev->dev, 2886 dev_info(host->dev,
2900 "flags: " 2887 "flags: "
2901 "%s%s%s%s%s%s%s" 2888 "%s%s%s%s%s%s%s"
2902 "%s%s%s%s%s%s%s" 2889 "%s%s%s%s%s%s%s"
@@ -2926,6 +2913,25 @@ static void ahci_print_info(struct ata_host *host)
2926 ); 2913 );
2927} 2914}
2928 2915
2916static void ahci_pci_print_info(struct ata_host *host)
2917{
2918 struct pci_dev *pdev = to_pci_dev(host->dev);
2919 u16 cc;
2920 const char *scc_s;
2921
2922 pci_read_config_word(pdev, 0x0a, &cc);
2923 if (cc == PCI_CLASS_STORAGE_IDE)
2924 scc_s = "IDE";
2925 else if (cc == PCI_CLASS_STORAGE_SATA)
2926 scc_s = "SATA";
2927 else if (cc == PCI_CLASS_STORAGE_RAID)
2928 scc_s = "RAID";
2929 else
2930 scc_s = "unknown";
2931
2932 ahci_print_info(host, scc_s);
2933}
2934
2929/* On ASUS P5W DH Deluxe, the second port of PCI device 00:1f.2 is 2935/* On ASUS P5W DH Deluxe, the second port of PCI device 00:1f.2 is
2930 * hardwired to on-board SIMG 4726. The chipset is ICH8 and doesn't 2936 * hardwired to on-board SIMG 4726. The chipset is ICH8 and doesn't
2931 * support PMP and the 4726 either directly exports the device 2937 * support PMP and the 4726 either directly exports the device
@@ -3459,7 +3465,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
3459 return rc; 3465 return rc;
3460 3466
3461 ahci_pci_init_controller(host); 3467 ahci_pci_init_controller(host);
3462 ahci_print_info(host); 3468 ahci_pci_print_info(host);
3463 3469
3464 pci_set_master(pdev); 3470 pci_set_master(pdev);
3465 return ata_host_activate(host, pdev->irq, ahci_interrupt, IRQF_SHARED, 3471 return ata_host_activate(host, pdev->irq, ahci_interrupt, IRQF_SHARED,