Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174831
b: refs/heads/master
c: 1ce5e83
h: refs/heads/master
i:
  174829: c85c779
  174827: bc78683
  174823: c88da19
  174815: b4c7581
v: v3
  • Loading branch information
Kenji Kaneshige authored and Jesse Barnes committed Dec 4, 2009
1 parent bdcae22 commit 4a9a7b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dc5351784eb36f1fec4efa88e01581be72c0b711
refs/heads/master: 1ce5e83063bf388a2c9fa1e3d4d3122146ad305d
21 changes: 11 additions & 10 deletions trunk/drivers/pci/pcie/portdrv_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@ int pcie_port_device_register(struct pci_dev *dev)
port_data->port_type = dev->pcie_type;
pci_set_drvdata(dev, port_data);

/* Enable PCI Express port device */
status = pci_enable_device(dev);
if (status)
goto error_kfree;
pci_set_master(dev);

/*
* Initialize service irqs. Don't use service devices that
* require interrupts if there is no way to generate them.
Expand All @@ -310,14 +316,9 @@ int pcie_port_device_register(struct pci_dev *dev)
if (status) {
capabilities &= PCIE_PORT_SERVICE_VC;
if (!capabilities)
goto Error;
goto error_disable;
}

status = pci_enable_device(dev);
if (status)
goto Error;
pci_set_master(dev);

/* Allocate child services if any */
for (i = 0, nr_serv = 0; i < PCIE_PORT_DEVICE_MAXSERVICES; i++) {
int service = 1 << i;
Expand All @@ -330,14 +331,14 @@ int pcie_port_device_register(struct pci_dev *dev)
nr_serv++;
}
if (!nr_serv) {
pci_disable_device(dev);
status = -ENODEV;
goto Error;
goto error_disable;
}

return 0;

Error:
error_disable:
pci_disable_device(dev);
error_kfree:
kfree(port_data);
return status;
}
Expand Down

0 comments on commit 4a9a7b8

Please sign in to comment.