Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174833
b: refs/heads/master
c: 40717c3
h: refs/heads/master
i:
  174831: 4a9a7b8
v: v3
  • Loading branch information
Kenji Kaneshige authored and Jesse Barnes committed Dec 4, 2009
1 parent 989a123 commit 91105a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 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: fbb5de70bbe13ecbebb04226dd6d52b1258dc247
refs/heads/master: 40717c39b1e6c064f48a263a27e58642221e8661
21 changes: 10 additions & 11 deletions trunk/drivers/pci/pcie/portdrv_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,15 @@ static int pcie_device_init(struct pci_dev *pdev, int service, int irq)
int pcie_port_device_register(struct pci_dev *dev)
{
struct pcie_port_data *port_data;
int status, capabilities, i, nr_serv;
int status, capabilities, i, nr_service;
int irqs[PCIE_PORT_DEVICE_MAXSERVICES];

/* Get and check PCI Express port services */
capabilities = get_port_device_capability(dev);
if (!capabilities)
return -ENODEV;

/* Allocate driver data for port device */
port_data = kzalloc(sizeof(*port_data), GFP_KERNEL);
if (!port_data)
return -ENOMEM;
Expand All @@ -315,7 +317,6 @@ int pcie_port_device_register(struct pci_dev *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 @@ -328,20 +329,18 @@ int pcie_port_device_register(struct pci_dev *dev)
}

/* Allocate child services if any */
for (i = 0, nr_serv = 0; i < PCIE_PORT_DEVICE_MAXSERVICES; i++) {
status = -ENODEV;
nr_service = 0;
for (i = 0; i < PCIE_PORT_DEVICE_MAXSERVICES; i++) {
int service = 1 << i;

if (!(capabilities & service))
continue;

status = pcie_device_init(dev, service, irqs[i]);
if (!status)
nr_serv++;
if (!pcie_device_init(dev, service, irqs[i]))
nr_service++;
}
if (!nr_serv) {
status = -ENODEV;
if (!nr_service)
goto error_cleanup_irqs;
}

return 0;

error_cleanup_irqs:
Expand Down

0 comments on commit 91105a3

Please sign in to comment.