Commit 0b29fac8 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] PCI: remove usage of pci_for_each_dev() in drivers/video/sis/sis_main.c

parent 7d0d5418
...@@ -134,15 +134,9 @@ sisfb_query_VGA_config_space(PSIS_HW_DEVICE_INFO psishw_ext, ...@@ -134,15 +134,9 @@ sisfb_query_VGA_config_space(PSIS_HW_DEVICE_INFO psishw_ext,
if (!init) { if (!init) {
init = TRUE; init = TRUE;
pci_for_each_dev(pdev) { pdev = pci_find_device(PCI_VENDOR_ID_SI, ivideo.chip_id, pdev);
DPRINTK("sisfb: Current: 0x%x, target: 0x%x\n", if (pdev)
pdev->device, ivideo.chip_id);
if ((pdev->vendor == PCI_VENDOR_ID_SI)
&& (pdev->device == ivideo.chip_id)) {
valid_pdev = TRUE; valid_pdev = TRUE;
break;
}
}
} }
if (!valid_pdev) { if (!valid_pdev) {
...@@ -192,15 +186,9 @@ BOOLEAN sisfb_query_north_bridge_space(PSIS_HW_DEVICE_INFO psishw_ext, ...@@ -192,15 +186,9 @@ BOOLEAN sisfb_query_north_bridge_space(PSIS_HW_DEVICE_INFO psishw_ext,
break; break;
} }
pci_for_each_dev(pdev) { pdev = pci_find_device(PCI_VENDOR_ID_SI, nbridge_id, pdev);
DPRINTK("Current: 0x%x, target: 0x%x\n", if (pdev)
pdev->device, ivideo.chip_id);
if ((pdev->vendor == PCI_VENDOR_ID_SI)
&& (pdev->device == nbridge_id)) {
valid_pdev = TRUE; valid_pdev = TRUE;
break;
}
}
} }
if (!valid_pdev) { if (!valid_pdev) {
...@@ -2117,10 +2105,8 @@ static int sisfb_get_dram_size_300(void) ...@@ -2117,10 +2105,8 @@ static int sisfb_get_dram_size_300(void)
} else { /* 540, 630, 730 */ } else { /* 540, 630, 730 */
pci_for_each_dev(pdev) { pdev = pci_find_device(PCI_VENDOR_ID_SI, nbridge_id, pdev);
if (pdev) {
if ((pdev->vendor == PCI_VENDOR_ID_SI)
&& (pdev->device == nbridge_id)) {
pci_read_config_byte(pdev, IND_BRI_DRAM_STATUS, &pci_data); pci_read_config_byte(pdev, IND_BRI_DRAM_STATUS, &pci_data);
pci_data = (pci_data & BRI_DRAM_SIZE_MASK) >> 4; pci_data = (pci_data & BRI_DRAM_SIZE_MASK) >> 4;
ivideo.video_size = (unsigned int)(1 << (pci_data+21)); ivideo.video_size = (unsigned int)(1 << (pci_data+21));
...@@ -2148,8 +2134,6 @@ static int sisfb_get_dram_size_300(void) ...@@ -2148,8 +2134,6 @@ static int sisfb_get_dram_size_300(void)
break; break;
} }
outSISIDXREG(SISSR, IND_SIS_DRAM_SIZE, reg); outSISIDXREG(SISSR, IND_SIS_DRAM_SIZE, reg);
break;
}
} }
if (!pdev_valid) return -1; if (!pdev_valid) return -1;
...@@ -2334,12 +2318,10 @@ static int sisfb_get_dram_size_315(void) ...@@ -2334,12 +2318,10 @@ static int sisfb_get_dram_size_315(void)
#ifdef LINUXBIOS #ifdef LINUXBIOS
pci_for_each_dev(pdev) { while ((pdev = pci_find_device(PCI_VENDOR_ID_SI, PCI_ANY_ID, pdev)) != NULL) {
if ((pdev->device == PCI_DEVICE_ID_SI_550) ||
if ( (pdev->vendor == PCI_VENDOR_ID_SI)
&& ( (pdev->device == PCI_DEVICE_ID_SI_550) ||
(pdev->device == PCI_DEVICE_ID_SI_650) || (pdev->device == PCI_DEVICE_ID_SI_650) ||
(pdev->device == PCI_DEVICE_ID_SI_740))) { (pdev->device == PCI_DEVICE_ID_SI_740)) {
pci_read_config_byte(pdev, IND_BRI_DRAM_STATUS, pci_read_config_byte(pdev, IND_BRI_DRAM_STATUS,
&pci_data); &pci_data);
pci_data = (pci_data & BRI_DRAM_SIZE_MASK) >> 4; pci_data = (pci_data & BRI_DRAM_SIZE_MASK) >> 4;
...@@ -2408,11 +2390,7 @@ static int sisfb_get_dram_size_315(void) ...@@ -2408,11 +2390,7 @@ static int sisfb_get_dram_size_315(void)
"now reading from PCI config\n"); "now reading from PCI config\n");
pdev_valid = 0; pdev_valid = 0;
pci_for_each_dev(pdev) { while ((pdev = pci_find_device(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_550, pdev)) != NULL) {
if ( (pdev->vendor == PCI_VENDOR_ID_SI)
&& (pdev->device == PCI_DEVICE_ID_SI_550) ) {
pci_read_config_byte(pdev, IND_BRI_DRAM_STATUS, pci_read_config_byte(pdev, IND_BRI_DRAM_STATUS,
&pci_data); &pci_data);
pci_data = (pci_data & BRI_DRAM_SIZE_MASK) >> 4; pci_data = (pci_data & BRI_DRAM_SIZE_MASK) >> 4;
...@@ -2438,7 +2416,6 @@ static int sisfb_get_dram_size_315(void) ...@@ -2438,7 +2416,6 @@ static int sisfb_get_dram_size_315(void)
} }
outSISIDXREG(SISSR, IND_SIS_DRAM_SIZE, reg); outSISIDXREG(SISSR, IND_SIS_DRAM_SIZE, reg);
} }
}
if (!pdev_valid) { if (!pdev_valid) {
printk(KERN_INFO "sisfb: Total confusion - No SiS PCI VGA device found?!\n"); printk(KERN_INFO "sisfb: Total confusion - No SiS PCI VGA device found?!\n");
return -1; return -1;
...@@ -3785,7 +3762,7 @@ int __init sisfb_init(void) ...@@ -3785,7 +3762,7 @@ int __init sisfb_init(void)
memset(&sis_disp, 0, sizeof(sis_disp)); memset(&sis_disp, 0, sizeof(sis_disp));
#endif #endif
pci_for_each_dev(pdev) { while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
for (b = sisdev_list; b->vendor; b++) { for (b = sisdev_list; b->vendor; b++) {
if ((b->vendor == pdev->vendor) if ((b->vendor == pdev->vendor)
&& (b->device == pdev->device)) { && (b->device == pdev->device)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment