--- initial
+++ final
@@ -1,166 +1,165 @@
 static int qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) {
   struct net_device *netdev = NULL;
   struct qlcnic_adapter *adapter = NULL;
   struct qlcnic_hardware_context *ahw;
   int err, pci_using_dac = -1;
   char board_name[QLCNIC_MAX_BOARD_NAME_LEN + 19]; /* MAC + ": " + name */
   struct qlcnic_dcb *dcb;
   if (pdev->is_virtfn) return -ENODEV;
   err = pci_enable_device(pdev);
   if (err) return err;
   if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
     err = -ENODEV;
     goto err_out_disable_pdev;
   }
   err = qlcnic_set_dma_mask(pdev, &pci_using_dac);
   if (err) goto err_out_disable_pdev;
   err = pci_request_regions(pdev, qlcnic_driver_name);
   if (err) goto err_out_disable_pdev;
   pci_set_master(pdev);
   pci_enable_pcie_error_reporting(pdev);
   ahw = kzalloc(sizeof(struct qlcnic_hardware_context), GFP_KERNEL);
   if (!ahw) {
     err = -ENOMEM;
     goto err_out_free_res;
   }
   switch (ent->device) {
   case PCI_DEVICE_ID_QLOGIC_QLE824X:
     ahw->hw_ops = &qlcnic_hw_ops;
     ahw->reg_tbl = (u32 *)qlcnic_reg_tbl;
     break;
   case PCI_DEVICE_ID_QLOGIC_QLE834X:
   case PCI_DEVICE_ID_QLOGIC_QLE844X: qlcnic_83xx_register_map(ahw); break;
   case PCI_DEVICE_ID_QLOGIC_VF_QLE834X:
   case PCI_DEVICE_ID_QLOGIC_VF_QLE844X: qlcnic_sriov_vf_register_map(ahw); break;
   default: goto err_out_free_hw_res;
   }
   err = qlcnic_setup_pci_map(pdev, ahw);
   if (err) goto err_out_free_hw_res;
   netdev = alloc_etherdev_mq(sizeof(struct qlcnic_adapter), QLCNIC_MAX_TX_RINGS);
   if (!netdev) {
     err = -ENOMEM;
     goto err_out_iounmap;
   }
   SET_NETDEV_DEV(netdev, &pdev->dev);
   adapter = netdev_priv(netdev);
   adapter->netdev = netdev;
   adapter->pdev = pdev;
   adapter->ahw = ahw;
   adapter->qlcnic_wq = create_singlethread_workqueue("qlcnic");
   if (adapter->qlcnic_wq == NULL) {
     err = -ENOMEM;
     dev_err(&pdev->dev, "Failed to create workqueue\n");
     goto err_out_free_netdev;
   }
   err = qlcnic_alloc_adapter_resources(adapter);
   if (err) goto err_out_free_wq;
   adapter->dev_rst_time = jiffies;
   adapter->ahw->revision_id = pdev->revision;
   if (qlcnic_mac_learn == FDB_MAC_LEARN)
     adapter->fdb_mac_learn = true;
   else if (qlcnic_mac_learn == DRV_MAC_LEARN)
     adapter->drv_mac_learn = true;
   rwlock_init(&adapter->ahw->crb_lock);
   mutex_init(&adapter->ahw->mem_lock);
   INIT_LIST_HEAD(&adapter->mac_list);
   qlcnic_register_dcb(adapter);
   if (qlcnic_82xx_check(adapter)) {
     qlcnic_check_vf(adapter, ent);
     adapter->portnum = adapter->ahw->pci_func;
     err = qlcnic_start_firmware(adapter);
     if (err) {
       dev_err(&pdev->dev, "Loading fw failed.Please Reboot\n"
                           "\t\tIf reboot doesn't help, try flashing the card\n");
       goto err_out_maintenance_mode;
     }
     qlcnic_get_multiq_capability(adapter);
     if ((adapter->ahw->act_pci_func > 2) && qlcnic_check_multi_tx(adapter)) {
       adapter->max_drv_tx_rings = QLCNIC_DEF_NUM_TX_RINGS;
       dev_info(&adapter->pdev->dev, "vNIC mode enabled, Set max TX rings = %d\n", adapter->max_drv_tx_rings);
     }
     if (!qlcnic_check_multi_tx(adapter)) {
       clear_bit(__QLCNIC_MULTI_TX_UNIQUE, &adapter->state);
       adapter->max_drv_tx_rings = 1;
     }
     err = qlcnic_setup_idc_param(adapter);
     if (err) goto err_out_free_hw;
     adapter->flags |= QLCNIC_NEED_FLR;
     dcb = adapter->dcb;
     if (dcb && qlcnic_dcb_attach(dcb)) qlcnic_clear_dcb_ops(dcb);
   } else if (qlcnic_83xx_check(adapter)) {
     adapter->max_drv_tx_rings = 1;
     qlcnic_83xx_check_vf(adapter, ent);
     adapter->portnum = adapter->ahw->pci_func;
     err = qlcnic_83xx_init(adapter, pci_using_dac);
     if (err) {
       dev_err(&pdev->dev, "%s: failed\n", __func__);
       goto err_out_free_hw;
     }
     if (qlcnic_sriov_vf_check(adapter)) return 0;
   } else {
     dev_err(&pdev->dev, "%s: failed. Please Reboot\n", __func__);
     goto err_out_free_hw;
   }
   if (qlcnic_read_mac_addr(adapter)) dev_warn(&pdev->dev, "failed to read mac addr\n");
   qlcnic_read_phys_port_id(adapter);
   if (adapter->portnum == 0) {
     qlcnic_get_board_name(adapter, board_name);
     pr_info("%s: %s Board Chip rev 0x%x\n", module_name(THIS_MODULE), board_name, adapter->ahw->revision_id);
   }
   if (qlcnic_83xx_check(adapter) && !qlcnic_use_msi_x && !!qlcnic_use_msi) dev_warn(&pdev->dev, "Device does not support MSI interrupts\n");
   if (qlcnic_82xx_check(adapter)) {
     err = qlcnic_setup_intr(adapter, 0, 0);
     if (err) {
       dev_err(&pdev->dev, "Failed to setup interrupt\n");
       goto err_out_disable_msi;
     }
   }
   err = qlcnic_get_act_pci_func(adapter);
   if (err) goto err_out_disable_mbx_intr;
   err = qlcnic_setup_netdev(adapter, netdev, pci_using_dac);
   if (err) goto err_out_disable_mbx_intr;
   if (adapter->portnum == 0) qlcnic_set_drv_version(adapter);
   pci_set_drvdata(pdev, adapter);
   if (qlcnic_82xx_check(adapter)) qlcnic_schedule_work(adapter, qlcnic_fw_poll_work, FW_POLL_DELAY);
   switch (adapter->ahw->port_type) {
   case QLCNIC_GBE: dev_info(&adapter->pdev->dev, "%s: GbE port initialized\n", adapter->netdev->name); break;
   case QLCNIC_XGBE: dev_info(&adapter->pdev->dev, "%s: XGbE port initialized\n", adapter->netdev->name); break;
   }
   if (adapter->drv_mac_learn) qlcnic_alloc_lb_filters_mem(adapter);
   qlcnic_add_sysfs(adapter);
   return 0;
 err_out_disable_mbx_intr:
   if (qlcnic_83xx_check(adapter)) qlcnic_83xx_free_mbx_intr(adapter);
 err_out_disable_msi:
   qlcnic_teardown_intr(adapter);
   qlcnic_cancel_idc_work(adapter);
   qlcnic_clr_all_drv_state(adapter, 0);
 err_out_free_hw:
   qlcnic_free_adapter_resources(adapter);
 err_out_free_wq:
   destroy_workqueue(adapter->qlcnic_wq);
 err_out_free_netdev:
   free_netdev(netdev);
 err_out_iounmap:
   qlcnic_cleanup_pci_map(ahw);
 err_out_free_hw_res:
   kfree(ahw);
 err_out_free_res:
   pci_release_regions(pdev);
 err_out_disable_pdev:
-  pci_set_drvdata(pdev, NULL);
   pci_disable_device(pdev);
   return err;
 err_out_maintenance_mode:
   netdev->netdev_ops = &qlcnic_netdev_failed_ops;
   SET_ETHTOOL_OPS(netdev, &qlcnic_ethtool_failed_ops);
   err = register_netdev(netdev);
   if (err) {
     dev_err(&pdev->dev, "Failed to register net device\n");
     qlcnic_clr_all_drv_state(adapter, 0);
     goto err_out_free_hw;
   }
   pci_set_drvdata(pdev, adapter);
   qlcnic_add_sysfs(adapter);
   return 0;
 }<sep>@@
expression pci;
@@

- pci_set_drvdata(pci, NULL);