/* If detected invokes the pcie_port_device_register() method for this port device.  */
static int __devinit pcie_portdrv_probe(struct pci_dev *dev, const struct pci_device_id *id)
/* If detected invokes the pcie_port_device_register() method for this port device.  */
static int __devinit pcie_portdrv_probe(struct pci_dev *dev, const struct pci_device_id *id)
{
	int status;
	if (!pci_is_pcie(dev) ||
	    ((dev->pcie_type != PCI_EXP_TYPE_ROOT_PORT) &&
	     (dev->pcie_type != PCI_EXP_TYPE_UPSTREAM) &&
	     (dev->pcie_type != PCI_EXP_TYPE_DOWNSTREAM)))
		return -ENODEV;
	if (!dev->irq && dev->pin) {
		dev_warn(&dev->dev, "device [%04x:%04x] has invalid IRQ; "
			 "check vendor BIOS\n", dev->vendor, dev->device);
	}
	status = pcie_port_device_register(dev);
	if (status)
		return status;
	pci_save_state(dev);
	return 0;
}