PCI: portdrv: check capabilities first

Move capability check capability to the beginning of
pcie_port_device_register() prevents redundant execution path.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
This commit is contained in:
Kenji Kaneshige 2009-11-25 21:03:27 +09:00 committed by Jesse Barnes
parent 9e5d0b16da
commit d013598d9a
1 changed files with 4 additions and 2 deletions

View File

@ -297,6 +297,10 @@ int pcie_port_device_register(struct pci_dev *dev)
int status, capabilities, irq_mode, i, nr_serv;
int vectors[PCIE_PORT_DEVICE_MAXSERVICES];
capabilities = get_port_device_capability(dev);
if (!capabilities)
return -ENODEV;
port_data = kzalloc(sizeof(*port_data), GFP_KERNEL);
if (!port_data)
return -ENOMEM;
@ -304,8 +308,6 @@ int pcie_port_device_register(struct pci_dev *dev)
port_data->port_type = dev->pcie_type;
capabilities = get_port_device_capability(dev);
irq_mode = assign_interrupt_mode(dev, vectors, capabilities);
if (irq_mode == PCIE_PORT_NO_IRQ) {
/*