title: Sharing PCI device with 2 different PCI drivers
body: <p>I am writing pci driver to access the Intel device with ID PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0., which is at ff:12.0 (device ID 0x6fa0).</p>
  
  <p>But, turned out sbridge_edac driver was already installed and associated with that PCI device.  This causes my pci_register_driver() to return error.
  Is there a way to make my PCI driver use that PCI device if another driver already associated with it?</p>
  
  <pre><code>#define PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0   0x6fa0
  
  static const struct pci_device_id sbridge_pci_tbl[] = {
      {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_HA0)},
     {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IBRIDGE_IMC_HA0_TA)},
      {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HASWELL_IMC_HA0)},
      {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BROADWELL_IMC_HA0)},
      {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KNL_IMC_SAD0)},
      {0,}            /* 0 terminated list. */
  };
  
  MODULE_DEVICE_TABLE(pci, sbridge_pci_tbl);
  
  static struct pci_driver discovery_pci_driver ={
      .name       = DRIVER_NAME,
      .probe      = discovery_probe,
      .remove     = discovery_remove,
      .id_table   = sbridge_pci_tbl,
  };
  
  static int __init discovery_init(void)
  {
      int res;
  
      res = pci_register_driver(&amp;discovery_pci_driver);
      if(res&lt;0) {
          PERR("Adding driver to pci core failed\n");
         return res;
  }
  
  
  return 0;
  }
  
  
  $lspci -x
  
  ff:12.0 System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Home Agent 0
      Subsystem: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Home Agent 0
      Kernel driver in use: sbridge_edac
  </code></pre>