/* Returns the appropriate pci_driver structure or NULL if there is no registered driver for the device.  */
struct pci_driver* pci_dev_driver(const struct pci_dev *dev)
/* Returns the appropriate pci_driver structure or NULL if there is no registered driver for the device.  */
struct pci_driver* pci_dev_driver(const struct pci_dev *dev)
{
	if (dev->driver)
		return dev->driver;
	else {
		int i;
		for(i=0; i<=PCI_ROM_RESOURCE; i++)
			if (dev->resource[i].flags & IORESOURCE_BUSY)
				return &pci_compat_driver;
	}
	return NULL;
}