Browse Source

Automatically modified by

perl -pi -0777 -e 's/\s*?if\s*\(\s*!\s*find_pci_device.*?,\s*\&(\w+)\s*\)\s*\)\s*return\s*0;(.*BOOT_DRIVER\s*\(.*?,)(.*?\))/$2 find_pci_boot_device, $1,$3/sm' *.c
tags/v0.9.3
Michael Brown 20 years ago
parent
commit
2c60617836

+ 1
- 4
src/drivers/net/3c595.c View File

473
 	int i;
473
 	int i;
474
 	unsigned short *p;
474
 	unsigned short *p;
475
 
475
 
476
-	if ( ! find_pci_device ( pci, &t595_driver ) )
477
-		return 0;
478
-
479
 	if (pci->ioaddr == 0)
476
 	if (pci->ioaddr == 0)
480
 		return 0;
477
 		return 0;
481
 	eth_nic_base = pci->ioaddr;
478
 	eth_nic_base = pci->ioaddr;
543
 static struct pci_driver t595_driver =
540
 static struct pci_driver t595_driver =
544
 	PCI_DRIVER ( "3C595", t595_nics, PCI_NO_CLASS );
541
 	PCI_DRIVER ( "3C595", t595_nics, PCI_NO_CLASS );
545
 
542
 
546
-BOOT_DRIVER ( "3C595", t595_probe );
543
+BOOT_DRIVER ( "3C595", find_pci_boot_device, t595_driver, t595_probe );
547
 
544
 
548
 /*
545
 /*
549
  * Local variables:
546
  * Local variables:

+ 1
- 4
src/drivers/net/3c90x.c View File

699
     unsigned int mstat;
699
     unsigned int mstat;
700
     unsigned short linktype;
700
     unsigned short linktype;
701
 #define	HWADDR_OFFSET	10
701
 #define	HWADDR_OFFSET	10
702
-
703
-    if ( ! find_pci_device ( pci, &a3c90x_driver ) )
704
-	    return 0;
705
     
702
     
706
     if (pci->ioaddr == 0)
703
     if (pci->ioaddr == 0)
707
           return 0;
704
           return 0;
994
 static struct pci_driver a3c90x_driver =
991
 static struct pci_driver a3c90x_driver =
995
 	PCI_DRIVER ( "3C90X", a3c90x_nics, PCI_NO_CLASS );
992
 	PCI_DRIVER ( "3C90X", a3c90x_nics, PCI_NO_CLASS );
996
 
993
 
997
-BOOT_DRIVER ( "3C90X", a3c90x_probe );
994
+BOOT_DRIVER ( "3C90X", find_pci_boot_device, a3c90x_driver, a3c90x_probe );

+ 1
- 4
src/drivers/net/davicom.c View File

661
 
661
 
662
   whereami("davicom_probe\n");
662
   whereami("davicom_probe\n");
663
 
663
 
664
-  if ( ! find_pci_device ( pci, &davicom_driver ) )
665
-	  return 0;
666
-
667
   if (pci->ioaddr == 0)
664
   if (pci->ioaddr == 0)
668
     return 0;
665
     return 0;
669
 
666
 
719
 static struct pci_driver davicom_driver =
716
 static struct pci_driver davicom_driver =
720
 	PCI_DRIVER ( "DAVICOM", davicom_nics, PCI_NO_CLASS );
717
 	PCI_DRIVER ( "DAVICOM", davicom_nics, PCI_NO_CLASS );
721
 
718
 
722
-BOOT_DRIVER ( "DAVICOM", davicom_probe );
719
+BOOT_DRIVER ( "DAVICOM", find_pci_boot_device, davicom_driver, davicom_probe );

+ 1
- 4
src/drivers/net/dmfe.c View File

464
 	uint32_t dev_rev, pci_pmr;
464
 	uint32_t dev_rev, pci_pmr;
465
 	int i;
465
 	int i;
466
 
466
 
467
-	if ( ! find_pci_device ( pci, &dmfe_driver ) )
468
-		return 0;
469
-
470
 	if (pci->ioaddr == 0)
467
 	if (pci->ioaddr == 0)
471
 		return 0;
468
 		return 0;
472
 
469
 
1229
 static struct pci_driver dmfe_driver =
1226
 static struct pci_driver dmfe_driver =
1230
 	PCI_DRIVER ( "DMFE/PCI", dmfe_nics, PCI_NO_CLASS );
1227
 	PCI_DRIVER ( "DMFE/PCI", dmfe_nics, PCI_NO_CLASS );
1231
 
1228
 
1232
-BOOT_DRIVER ( "DMFE/PCI", dmfe_probe );
1229
+BOOT_DRIVER ( "DMFE/PCI", find_pci_boot_device, dmfe_driver, dmfe_probe );

+ 1
- 4
src/drivers/net/e1000.c View File

3587
 	unsigned long mmio_start, mmio_len;
3587
 	unsigned long mmio_start, mmio_len;
3588
 	int ret_val, i;
3588
 	int ret_val, i;
3589
 
3589
 
3590
-	if ( ! find_pci_device ( p, &e1000_driver ) )
3591
-		return 0;
3592
-
3593
 	/* Initialize hw with default values */
3590
 	/* Initialize hw with default values */
3594
 	memset(&hw, 0, sizeof(hw));
3591
 	memset(&hw, 0, sizeof(hw));
3595
 	hw.pdev = p;
3592
 	hw.pdev = p;
3713
 static struct pci_driver e1000_driver =
3710
 static struct pci_driver e1000_driver =
3714
 	PCI_DRIVER ( "E1000", e1000_nics, PCI_NO_CLASS );
3711
 	PCI_DRIVER ( "E1000", e1000_nics, PCI_NO_CLASS );
3715
 
3712
 
3716
-BOOT_DRIVER ( "E1000", e1000_probe );
3713
+BOOT_DRIVER ( "E1000", find_pci_boot_device, e1000_driver, e1000_probe );

+ 1
- 4
src/drivers/net/eepro100.c View File

615
 	   be careful not to access beyond this array */
615
 	   be careful not to access beyond this array */
616
 	unsigned short eeprom[16];
616
 	unsigned short eeprom[16];
617
 
617
 
618
-	if ( ! find_pci_device ( p, &eepro100_driver ) )
619
-		return 0;
620
-
621
 	if (p->ioaddr == 0)
618
 	if (p->ioaddr == 0)
622
 		return 0;
619
 		return 0;
623
 	ioaddr = p->ioaddr;
620
 	ioaddr = p->ioaddr;
840
 static struct pci_driver eepro100_driver =
837
 static struct pci_driver eepro100_driver =
841
 	PCI_DRIVER ( "EEPRO100", eepro100_nics, PCI_NO_CLASS );
838
 	PCI_DRIVER ( "EEPRO100", eepro100_nics, PCI_NO_CLASS );
842
 
839
 
843
-BOOT_DRIVER ( "EEPRO100", eepro100_probe );
840
+BOOT_DRIVER ( "EEPRO100", find_pci_boot_device, eepro100_driver, eepro100_probe );

+ 1
- 4
src/drivers/net/epic100.c View File

105
     unsigned short* ap;
105
     unsigned short* ap;
106
     unsigned int phy, phy_idx;
106
     unsigned int phy, phy_idx;
107
 
107
 
108
-    if ( ! find_pci_device ( pci, &epic100_driver ) )
109
-	    return 0;
110
-
111
     if (pci->ioaddr == 0)
108
     if (pci->ioaddr == 0)
112
 	return 0;
109
 	return 0;
113
 
110
 
521
 static struct pci_driver epic100_driver =
518
 static struct pci_driver epic100_driver =
522
 	PCI_DRIVER ( "EPIC100", epic100_nics, PCI_NO_CLASS );
519
 	PCI_DRIVER ( "EPIC100", epic100_nics, PCI_NO_CLASS );
523
 
520
 
524
-BOOT_DRIVER ( "EPIC100", epic100_probe );
521
+BOOT_DRIVER ( "EPIC100", find_pci_boot_device, epic100_driver, epic100_probe );

+ 1
- 4
src/drivers/net/forcedeth.c View File

947
 	int sz;
947
 	int sz;
948
 	u8 *base;
948
 	u8 *base;
949
 
949
 
950
-	if ( ! find_pci_device ( pci, &forcedeth_driver ) )
951
-		return 0;
952
-
953
 	if (pci->ioaddr == 0)
950
 	if (pci->ioaddr == 0)
954
 		return 0;
951
 		return 0;
955
 
952
 
1038
 	/* else */
1035
 	/* else */
1039
 }
1036
 }
1040
 
1037
 
1041
-BOOT_DRIVER ( "forcedeth", forcedeth_probe );
1038
+BOOT_DRIVER ( "forcedeth", find_pci_boot_device, forcedeth_driver, forcedeth_probe );

+ 1
- 4
src/drivers/net/mtd80x.c View File

678
     struct nic *nic = nic_device ( dev );
678
     struct nic *nic = nic_device ( dev );
679
     int i;
679
     int i;
680
 
680
 
681
-    if ( ! find_pci_device ( pci, &mtd80x_driver ) )
682
-	    return 0;
683
-
684
     if (pci->ioaddr == 0)
681
     if (pci->ioaddr == 0)
685
 	    return 0;
682
 	    return 0;
686
 
683
 
1087
     }
1084
     }
1088
 }
1085
 }
1089
 
1086
 
1090
-BOOT_DRIVER ( "MTD80X", mtd_probe );
1087
+BOOT_DRIVER ( "MTD80X", find_pci_boot_device, mtd80x_driver, mtd_probe );

+ 1
- 4
src/drivers/net/natsemi.c View File

249
     int i;
249
     int i;
250
     int prev_eedata;
250
     int prev_eedata;
251
     u32 tmp;
251
     u32 tmp;
252
-    
253
-    if ( ! find_pci_device ( pci, &natsemi_driver ) )
254
-	return 0;
255
 
252
 
256
     if (pci->ioaddr == 0)
253
     if (pci->ioaddr == 0)
257
         return 0;
254
         return 0;
779
 static struct pci_driver natsemi_driver =
776
 static struct pci_driver natsemi_driver =
780
 	PCI_DRIVER ( "NATSEMI", natsemi_nics, PCI_NO_CLASS );
777
 	PCI_DRIVER ( "NATSEMI", natsemi_nics, PCI_NO_CLASS );
781
 
778
 
782
-BOOT_DRIVER ( "NATSEMI", natsemi_probe );
779
+BOOT_DRIVER ( "NATSEMI", find_pci_boot_device, natsemi_driver, natsemi_probe );

+ 1
- 4
src/drivers/net/ns83820.c View File

831
 	long addr;
831
 	long addr;
832
 	int using_dac = 0;
832
 	int using_dac = 0;
833
 
833
 
834
-	if ( ! find_pci_device ( pci, &ns83820_driver ) )
835
-		return 0;
836
-
837
 	if (pci->ioaddr == 0)
834
 	if (pci->ioaddr == 0)
838
 		return 0;
835
 		return 0;
839
 
836
 
1019
 	return 1;
1016
 	return 1;
1020
 }
1017
 }
1021
 
1018
 
1022
-BOOT_DRIVER ( "NS83820/PCI", ns83820_probe );
1019
+BOOT_DRIVER ( "NS83820/PCI", find_pci_boot_device, ns83820_driver, ns83820_probe );

+ 1
- 4
src/drivers/net/pcnet32.c View File

676
 	u8 promaddr[6];
676
 	u8 promaddr[6];
677
 	int shared = 1;
677
 	int shared = 1;
678
 
678
 
679
-	if ( ! find_pci_device ( pci, &pcnet32_driver ) )
680
-		return 0;
681
-
682
 	if (pci->ioaddr == 0)
679
 	if (pci->ioaddr == 0)
683
 		return 0;
680
 		return 0;
684
 
681
 
1005
 static struct pci_driver pcnet32_driver =
1002
 static struct pci_driver pcnet32_driver =
1006
 	PCI_DRIVER ( "PCNET32/PCI", pcnet32_nics, PCI_NO_CLASS );
1003
 	PCI_DRIVER ( "PCNET32/PCI", pcnet32_nics, PCI_NO_CLASS );
1007
 
1004
 
1008
-BOOT_DRIVER ( "PCNET32/PCI", pcnet32_probe );
1005
+BOOT_DRIVER ( "PCNET32/PCI", find_pci_boot_device, pcnet32_driver, pcnet32_probe );

+ 1
- 4
src/drivers/net/prism2_pci.c View File

31
   hfa384x_t *hw = &hw_global;
31
   hfa384x_t *hw = &hw_global;
32
   uint32_t membase = 0; /* Prism2.5 Memory Base */
32
   uint32_t membase = 0; /* Prism2.5 Memory Base */
33
 
33
 
34
-  if ( ! find_pci_device ( pci, &prism2_pci_driver ) )
35
-	  return 0;
36
-
37
   pci_read_config_dword( pci, PRISM2_PCI_MEM_BASE, &membase);
34
   pci_read_config_dword( pci, PRISM2_PCI_MEM_BASE, &membase);
38
   membase &= PCI_BASE_ADDRESS_MEM_MASK;
35
   membase &= PCI_BASE_ADDRESS_MEM_MASK;
39
   hw->membase = (uint32_t) phys_to_virt(membase);
36
   hw->membase = (uint32_t) phys_to_virt(membase);
43
   return prism2_probe ( nic, hw );
40
   return prism2_probe ( nic, hw );
44
 }   
41
 }   
45
 
42
 
46
-BOOT_DRIVER ( "Prism2_PCI", prism2_pci_probe );
43
+BOOT_DRIVER ( "Prism2_PCI", find_pci_boot_device, prism2_pci_driver, prism2_pci_probe );
47
 
44
 

+ 1
- 4
src/drivers/net/prism2_plx.c View File

96
   struct nic *nic = nic_device ( dev );
96
   struct nic *nic = nic_device ( dev );
97
   hfa384x_t *hw = &hw_global;
97
   hfa384x_t *hw = &hw_global;
98
 
98
 
99
-  if ( ! find_pci_device ( pci, &prism2_plx_driver ) )
100
-	  return 0;
101
-
102
   /* Find and intialise PLX Prism2 card */
99
   /* Find and intialise PLX Prism2 card */
103
   if ( ! prism2_find_plx ( hw, pci ) ) return 0;
100
   if ( ! prism2_find_plx ( hw, pci ) ) return 0;
104
   nic->ioaddr = hw->iobase;
101
   nic->ioaddr = hw->iobase;
106
   return prism2_probe ( nic, hw );
103
   return prism2_probe ( nic, hw );
107
 }
104
 }
108
 
105
 
109
-BOOT_DRIVER ( "Prism2_PLX", prism2_plx_probe );
106
+BOOT_DRIVER ( "Prism2_PLX", find_pci_boot_device, prism2_plx_driver, prism2_plx_probe );
110
 
107
 

+ 1
- 4
src/drivers/net/r8169.c View File

730
 	int i, rc;
730
 	int i, rc;
731
 	int option = -1, Cap10_100 = 0, Cap1000 = 0;
731
 	int option = -1, Cap10_100 = 0, Cap1000 = 0;
732
 
732
 
733
-	if ( ! find_pci_device ( pci, &r8169_driver ) )
734
-		return 0;
735
-
736
 	printf("r8169.c: Found %s, Vendor=%hX Device=%hX\n",
733
 	printf("r8169.c: Found %s, Vendor=%hX Device=%hX\n",
737
 	       dev->name, pci->vendor, pci->dev_id);
734
 	       dev->name, pci->vendor, pci->dev_id);
738
 
735
 
853
 
850
 
854
 }
851
 }
855
 
852
 
856
-BOOT_DRIVER ( "r8169/PCI", r8169_probe );
853
+BOOT_DRIVER ( "r8169/PCI", find_pci_boot_device, r8169_driver, r8169_probe );

+ 1
- 4
src/drivers/net/rtl8139.c View File

190
 	int addr_len;
190
 	int addr_len;
191
 	unsigned short *ap = (unsigned short*)nic->node_addr;
191
 	unsigned short *ap = (unsigned short*)nic->node_addr;
192
 
192
 
193
-	if ( ! find_pci_device ( pci, &rtl8139_driver ) )
194
-		return 0;
195
-
196
 	/* Copy ioaddr and IRQ from PCI information */
193
 	/* Copy ioaddr and IRQ from PCI information */
197
 	nic->ioaddr = pci->ioaddr;
194
 	nic->ioaddr = pci->ioaddr;
198
 	nic->irqno = pci->irq;
195
 	nic->irqno = pci->irq;
543
 static struct pci_driver rtl8139_driver =
540
 static struct pci_driver rtl8139_driver =
544
 	PCI_DRIVER ( "RTL8139", rtl8139_nics, PCI_NO_CLASS );
541
 	PCI_DRIVER ( "RTL8139", rtl8139_nics, PCI_NO_CLASS );
545
 
542
 
546
-BOOT_DRIVER ( "RTL8139", rtl8139_probe );
543
+BOOT_DRIVER ( "RTL8139", find_pci_boot_device, rtl8139_driver, rtl8139_probe );

+ 1
- 4
src/drivers/net/sundance.c View File

590
 	int i;
590
 	int i;
591
 	int speed;
591
 	int speed;
592
 
592
 
593
-	if ( ! find_pci_device ( pci, &sundance_driver ) )
594
-		return 0;
595
-
596
 	if (pci->ioaddr == 0)
593
 	if (pci->ioaddr == 0)
597
 		return 0;
594
 		return 0;
598
 
595
 
889
 static struct pci_driver sundance_driver =
886
 static struct pci_driver sundance_driver =
890
 	PCI_DRIVER ( "SUNDANCE/PCI", sundance_nics, PCI_NO_CLASS );
887
 	PCI_DRIVER ( "SUNDANCE/PCI", sundance_nics, PCI_NO_CLASS );
891
 
888
 
892
-BOOT_DRIVER ( "SUNDANCE/PCI", sundance_probe );
889
+BOOT_DRIVER ( "SUNDANCE/PCI", find_pci_boot_device, sundance_driver, sundance_probe );

+ 1
- 4
src/drivers/net/tg3.c View File

3270
 	unsigned long tg3reg_base, tg3reg_len;
3270
 	unsigned long tg3reg_base, tg3reg_len;
3271
 	int i, err, pm_cap;
3271
 	int i, err, pm_cap;
3272
 
3272
 
3273
-	if ( ! find_pci_device ( pdev, &tg3_driver ) )
3274
-		return 0;
3275
-
3276
 	memset(tp, 0, sizeof(*tp));
3273
 	memset(tp, 0, sizeof(*tp));
3277
 
3274
 
3278
 	nic->irqno  = 0;
3275
 	nic->irqno  = 0;
3389
 	return 0;
3386
 	return 0;
3390
 }
3387
 }
3391
 
3388
 
3392
-BOOT_DRIVER ( "TG3", tg3_probe );
3389
+BOOT_DRIVER ( "TG3", find_pci_boot_device, tg3_driver, tg3_probe );

+ 1
- 4
src/drivers/net/tlan.c View File

787
 	int err;
787
 	int err;
788
 	int i;
788
 	int i;
789
 
789
 
790
-	if ( ! find_pci_device ( pci, &tlan_driver ) )
791
-		return 0;
792
-
793
 	if (pci->ioaddr == 0)
790
 	if (pci->ioaddr == 0)
794
 		return 0;
791
 		return 0;
795
 
792
 
1717
 static struct pci_driver tlan_driver =
1714
 static struct pci_driver tlan_driver =
1718
 	PCI_DRIVER ( "TLAN/PCI", tlan_nics, PCI_NO_CLASS );
1715
 	PCI_DRIVER ( "TLAN/PCI", tlan_nics, PCI_NO_CLASS );
1719
 
1716
 
1720
-BOOT_DRIVER ( "TLAN/PCI", tlan_probe );
1717
+BOOT_DRIVER ( "TLAN/PCI", find_pci_boot_device, tlan_driver, tlan_probe );

+ 1
- 4
src/drivers/net/tulip.c View File

1234
     int chip_idx;
1234
     int chip_idx;
1235
     static unsigned char last_phys_addr[ETH_ALEN] = {0x00, 'L', 'i', 'n', 'u', 'x'};
1235
     static unsigned char last_phys_addr[ETH_ALEN] = {0x00, 'L', 'i', 'n', 'u', 'x'};
1236
 
1236
 
1237
-    if ( ! find_pci_device ( pci, &tulip_driver ) )
1238
-	return 0;
1239
-
1240
     if (pci->ioaddr == 0)
1237
     if (pci->ioaddr == 0)
1241
         return 0;
1238
         return 0;
1242
 
1239
 
2080
 static struct pci_driver tulip_driver =
2077
 static struct pci_driver tulip_driver =
2081
 	PCI_DRIVER ( "Tulip", tulip_nics, PCI_NO_CLASS );
2078
 	PCI_DRIVER ( "Tulip", tulip_nics, PCI_NO_CLASS );
2082
 
2079
 
2083
-BOOT_DRIVER ( "Tulip", tulip_probe );
2080
+BOOT_DRIVER ( "Tulip", find_pci_boot_device, tulip_driver, tulip_probe );

+ 1
- 4
src/drivers/net/via-rhine.c View File

958
     struct nic *nic = nic_device ( dev );
958
     struct nic *nic = nic_device ( dev );
959
     struct rhine_private *tp = (struct rhine_private *) nic->priv_data;
959
     struct rhine_private *tp = (struct rhine_private *) nic->priv_data;
960
 
960
 
961
-    if ( ! find_pci_device ( pci, &rhine_driver ) )
962
-	    return 0;
963
-
964
     if (!pci->ioaddr)
961
     if (!pci->ioaddr)
965
 	return 0;
962
 	return 0;
966
     rhine_probe1 (nic, pci, pci->ioaddr, pci->dev_id, -1);
963
     rhine_probe1 (nic, pci, pci->ioaddr, pci->dev_id, -1);
1424
 static struct pci_driver rhine_driver =
1421
 static struct pci_driver rhine_driver =
1425
 	PCI_DRIVER ( "VIA 86C100", rhine_nics, PCI_NO_CLASS );
1422
 	PCI_DRIVER ( "VIA 86C100", rhine_nics, PCI_NO_CLASS );
1426
 
1423
 
1427
-BOOT_DRIVER ( "VIA 86C100", rhine_probe );
1424
+BOOT_DRIVER ( "VIA 86C100", find_pci_boot_device, rhine_driver, rhine_probe );
1428
 
1425
 
1429
 /* EOF via-rhine.c */
1426
 /* EOF via-rhine.c */

+ 1
- 4
src/drivers/net/w89c840.c View File

626
 static int w89c840_probe ( struct dev *dev, struct pci_device *pci ) {
626
 static int w89c840_probe ( struct dev *dev, struct pci_device *pci ) {
627
     struct nic *nic = nic_device ( dev );
627
     struct nic *nic = nic_device ( dev );
628
 
628
 
629
-    if ( ! find_pci_device ( p, &w89c840_driver ) )
630
-	    return 0;
631
-
632
     u16 sum = 0;
629
     u16 sum = 0;
633
     int i, j;
630
     int i, j;
634
     unsigned short value;
631
     unsigned short value;
957
 }
954
 }
958
 
955
 
959
 
956
 
960
-BOOT_DRIVER ( "W89C840F", w89c840_probe );
957
+BOOT_DRIVER ( "W89C840F", find_pci_boot_device, w89c840_driver, w89c840_probe );

Loading…
Cancel
Save