title: Custom PCI driver fails to probe device
body: <p>After registering a PCI driver by calling <code>pci_register_driver()</code> within the <code>init_module</code> function, the driver is supposed to take control of any PCI devices which do not already have drivers, assuming that the devices match the vendor ID, device ID, etc. as specified in the <code>struct pci_device_id</code>.</p>
  
  <p>I would like to force the Ethernet Controller to use my driver, just for the sake of experimentation (e.g. reading configuration bytes). On a Virtualbox guest (Mint, kernel 3.13.0), I blacklisted the Ethernet Controller's driver, ran <code>update-initramfs -u</code>, and rebooted. This successfully disassociated the default driver from the Controller, as the driver no longer showed up in the output of <code>lspci -k</code>.</p>
  
  <p>However, when I loaded the module, a few devices that had previously been missing showed up in the output of <code>lspci -k</code> (with my driver controlling them), but the Ethernet Controller still lacked a <code>"Kernel driver in use: "</code> line. How can I make my module recognize and own the Controller?</p>
  
  <p>Note that I used <code>PCI_ANY_ID</code> for the vendor and device fields, and left the other fields of the <code>struct pci_device_id</code> uninitialized. So I would expect the driver to probe any device which currently lacks a driver.</p>
  
  <pre><code>#include &lt;linux/kernel.h&gt;
  #include &lt;linux/module.h&gt;
  #include &lt;linux/fs.h&gt;
  #include &lt;linux/pci.h&gt;
  
  MODULE_LICENSE("GPL");
  
  int init_module(void);
  void cleanup_module(void);
  static int pci_probe(struct pci_dev *, const struct pci_device_id *);
  static void pci_remove(struct pci_dev *dev);
  
  #define SUCCESS 0
  #define FAILURE -1
  
  
  static struct pci_device_id my_pci_id = {
          .vendor = PCI_ANY_ID,
          .device = PCI_ANY_ID
  };
  
  static struct pci_driver my_pci_driver = {
          .name = "kmod_driver",
          .id_table = &amp;my_pci_id,
          .probe = pci_probe,
          .remove = pci_remove
  };
  
  
  int init_module(void)
  {
          return pci_register_driver(&amp;my_pci_driver);
  }
  
  void cleanup_module(void)
  {
          pci_unregister_driver(&amp;my_pci_driver);
  }
  
  static int pci_probe(struct pci_dev *dev, const pci_device_id *id)
  {
          int enableStatus = pci_enable_device(dev);
          .....
          return SUCCESS;
  }
  
  static void pci_remove(struct pci_dev *dev)
  {
          return;
  }
  </code></pre>