Преглед изворни кода

[golan] Do not assume all devices are identical

Remove the global variable shomron_nodnic_supported, since it may have
different values for different PCI devices.

Originally-fixed-by: Mohammed Taha <mohammedt@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown пре 6 година
родитељ
комит
0778418e29
1 измењених фајлова са 2 додато и 5 уклоњено
  1. 2
    5
      src/drivers/infiniband/golan.c

+ 2
- 5
src/drivers/infiniband/golan.c Прегледај датотеку

@@ -2586,8 +2586,6 @@ struct flexboot_nodnic_callbacks shomron_nodnic_callbacks = {
2586 2586
 	.tx_uar_send_doorbell_fn = shomron_tx_uar_send_db,
2587 2587
 };
2588 2588
 
2589
-static int shomron_nodnic_supported = 0;
2590
-
2591 2589
 static int shomron_nodnic_is_supported ( struct pci_device *pci ) {
2592 2590
 	if ( DEVICE_IS_CIB ( pci->device ) )
2593 2591
 		return 0;
@@ -2607,8 +2605,7 @@ static int golan_probe ( struct pci_device *pci ) {
2607 2605
 		goto probe_done;
2608 2606
 	}
2609 2607
 
2610
-	shomron_nodnic_supported = shomron_nodnic_is_supported ( pci );
2611
-	if ( shomron_nodnic_supported ) {
2608
+	if ( shomron_nodnic_is_supported ( pci ) ) {
2612 2609
 		DBG ( "%s: Using NODNIC driver\n", __FUNCTION__ );
2613 2610
 		rc = flexboot_nodnic_probe ( pci, &shomron_nodnic_callbacks, NULL );
2614 2611
 	} else {
@@ -2624,7 +2621,7 @@ probe_done:
2624 2621
 static void golan_remove ( struct pci_device *pci ) {
2625 2622
 	DBG ( "%s: start\n", __FUNCTION__ );
2626 2623
 
2627
-	if ( ! shomron_nodnic_supported ) {
2624
+	if ( ! shomron_nodnic_is_supported ( pci ) ) {
2628 2625
 		DBG ( "%s: Using normal driver remove\n", __FUNCTION__ );
2629 2626
 		golan_remove_normal ( pci );
2630 2627
 		return;

Loading…
Откажи
Сачувај