aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ahci.c
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2010-03-03 12:17:37 -0500
committerJeff Garzik <jgarzik@redhat.com>2010-05-14 17:08:00 -0400
commit1d5133587366ee0cbd0be8f10b57a2636b628f9b (patch)
treec7e5d9eea19f8143a6fad747416ccf3d9ac7f392 /drivers/ata/ahci.c
parent394d6e535f15c6f2d3c7fe2e228ee595acf0648c (diff)
ahci: Get rid of pci_dev argument in ahci_save_initial_config()
To make the function generic we have to get rid of "struct pci_dev *", so let's pass just a "struct devce *". Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/ahci.c')
-rw-r--r--drivers/ata/ahci.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 530f0c1f1793..e49c32d51fda 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -840,7 +840,7 @@ static ssize_t ahci_show_port_cmd(struct device *dev,
840 840
841/** 841/**
842 * ahci_save_initial_config - Save and fixup initial config values 842 * ahci_save_initial_config - Save and fixup initial config values
843 * @pdev: target PCI device 843 * @dev: target AHCI device
844 * @hpriv: host private area to store config values 844 * @hpriv: host private area to store config values
845 * @force_port_map: force port map to a specified value 845 * @force_port_map: force port map to a specified value
846 * @mask_port_map: mask out particular bits from port map 846 * @mask_port_map: mask out particular bits from port map
@@ -855,7 +855,7 @@ static ssize_t ahci_show_port_cmd(struct device *dev,
855 * LOCKING: 855 * LOCKING:
856 * None. 856 * None.
857 */ 857 */
858static void ahci_save_initial_config(struct pci_dev *pdev, 858static void ahci_save_initial_config(struct device *dev,
859 struct ahci_host_priv *hpriv, 859 struct ahci_host_priv *hpriv,
860 unsigned int force_port_map, 860 unsigned int force_port_map,
861 unsigned int mask_port_map) 861 unsigned int mask_port_map)
@@ -883,45 +883,43 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
883 883
884 /* some chips have errata preventing 64bit use */ 884 /* some chips have errata preventing 64bit use */
885 if ((cap & HOST_CAP_64) && (hpriv->flags & AHCI_HFLAG_32BIT_ONLY)) { 885 if ((cap & HOST_CAP_64) && (hpriv->flags & AHCI_HFLAG_32BIT_ONLY)) {
886 dev_printk(KERN_INFO, &pdev->dev, 886 dev_printk(KERN_INFO, dev,
887 "controller can't do 64bit DMA, forcing 32bit\n"); 887 "controller can't do 64bit DMA, forcing 32bit\n");
888 cap &= ~HOST_CAP_64; 888 cap &= ~HOST_CAP_64;
889 } 889 }
890 890
891 if ((cap & HOST_CAP_NCQ) && (hpriv->flags & AHCI_HFLAG_NO_NCQ)) { 891 if ((cap & HOST_CAP_NCQ) && (hpriv->flags & AHCI_HFLAG_NO_NCQ)) {
892 dev_printk(KERN_INFO, &pdev->dev, 892 dev_printk(KERN_INFO, dev,
893 "controller can't do NCQ, turning off CAP_NCQ\n"); 893 "controller can't do NCQ, turning off CAP_NCQ\n");
894 cap &= ~HOST_CAP_NCQ; 894 cap &= ~HOST_CAP_NCQ;
895 } 895 }
896 896
897 if (!(cap & HOST_CAP_NCQ) && (hpriv->flags & AHCI_HFLAG_YES_NCQ)) { 897 if (!(cap & HOST_CAP_NCQ) && (hpriv->flags & AHCI_HFLAG_YES_NCQ)) {
898 dev_printk(KERN_INFO, &pdev->dev, 898 dev_printk(KERN_INFO, dev,
899 "controller can do NCQ, turning on CAP_NCQ\n"); 899 "controller can do NCQ, turning on CAP_NCQ\n");
900 cap |= HOST_CAP_NCQ; 900 cap |= HOST_CAP_NCQ;
901 } 901 }
902 902
903 if ((cap & HOST_CAP_PMP) && (hpriv->flags & AHCI_HFLAG_NO_PMP)) { 903 if ((cap & HOST_CAP_PMP) && (hpriv->flags & AHCI_HFLAG_NO_PMP)) {
904 dev_printk(KERN_INFO, &pdev->dev, 904 dev_printk(KERN_INFO, dev,
905 "controller can't do PMP, turning off CAP_PMP\n"); 905 "controller can't do PMP, turning off CAP_PMP\n");
906 cap &= ~HOST_CAP_PMP; 906 cap &= ~HOST_CAP_PMP;
907 } 907 }
908 908
909 if ((cap & HOST_CAP_SNTF) && (hpriv->flags & AHCI_HFLAG_NO_SNTF)) { 909 if ((cap & HOST_CAP_SNTF) && (hpriv->flags & AHCI_HFLAG_NO_SNTF)) {
910 dev_printk(KERN_INFO, &pdev->dev, 910 dev_printk(KERN_INFO, dev,
911 "controller can't do SNTF, turning off CAP_SNTF\n"); 911 "controller can't do SNTF, turning off CAP_SNTF\n");
912 cap &= ~HOST_CAP_SNTF; 912 cap &= ~HOST_CAP_SNTF;
913 } 913 }
914 914
915 if (force_port_map && port_map != force_port_map) { 915 if (force_port_map && port_map != force_port_map) {
916 dev_printk(KERN_INFO, &pdev->dev, 916 dev_printk(KERN_INFO, dev, "forcing port_map 0x%x -> 0x%x\n",
917 "forcing port_map 0x%x -> 0x%x\n",
918 port_map, force_port_map); 917 port_map, force_port_map);
919 port_map = force_port_map; 918 port_map = force_port_map;
920 } 919 }
921 920
922 if (mask_port_map) { 921 if (mask_port_map) {
923 dev_printk(KERN_ERR, &pdev->dev, 922 dev_printk(KERN_ERR, dev, "masking port_map 0x%x -> 0x%x\n",
924 "masking port_map 0x%x -> 0x%x\n",
925 port_map, 923 port_map,
926 port_map & mask_port_map); 924 port_map & mask_port_map);
927 port_map &= mask_port_map; 925 port_map &= mask_port_map;
@@ -939,7 +937,7 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
939 * port_map and let it be generated from n_ports. 937 * port_map and let it be generated from n_ports.
940 */ 938 */
941 if (map_ports > ahci_nr_ports(cap)) { 939 if (map_ports > ahci_nr_ports(cap)) {
942 dev_printk(KERN_WARNING, &pdev->dev, 940 dev_printk(KERN_WARNING, dev,
943 "implemented port map (0x%x) contains more " 941 "implemented port map (0x%x) contains more "
944 "ports than nr_ports (%u), using nr_ports\n", 942 "ports than nr_ports (%u), using nr_ports\n",
945 port_map, ahci_nr_ports(cap)); 943 port_map, ahci_nr_ports(cap));
@@ -950,7 +948,7 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
950 /* fabricate port_map from cap.nr_ports */ 948 /* fabricate port_map from cap.nr_ports */
951 if (!port_map) { 949 if (!port_map) {
952 port_map = (1 << ahci_nr_ports(cap)) - 1; 950 port_map = (1 << ahci_nr_ports(cap)) - 1;
953 dev_printk(KERN_WARNING, &pdev->dev, 951 dev_printk(KERN_WARNING, dev,
954 "forcing PORTS_IMPL to 0x%x\n", port_map); 952 "forcing PORTS_IMPL to 0x%x\n", port_map);
955 953
956 /* write the fixed up value to the PI register */ 954 /* write the fixed up value to the PI register */
@@ -988,7 +986,8 @@ static void ahci_pci_save_initial_config(struct pci_dev *pdev,
988 "Disabling your PATA port. Use the boot option 'ahci.marvell_enable=0' to avoid this.\n"); 986 "Disabling your PATA port. Use the boot option 'ahci.marvell_enable=0' to avoid this.\n");
989 } 987 }
990 988
991 ahci_save_initial_config(pdev, hpriv, force_port_map, mask_port_map); 989 ahci_save_initial_config(&pdev->dev, hpriv, force_port_map,
990 mask_port_map);
992} 991}
993 992
994/** 993/**