Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 307662
b: refs/heads/master
c: b3e35af
h: refs/heads/master
v: v3
  • Loading branch information
Mika Westerberg authored and Grant Likely committed Apr 6, 2012
1 parent 62c34ce commit ce90872
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 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: 8302c7413814e26959f69d36a0dcc1f945573bc9
refs/heads/master: b3e35af2b0ea9ad1618e01f40a1ffee83333ef35
16 changes: 13 additions & 3 deletions trunk/drivers/gpio/gpio-langwell.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ static int __devinit lnw_gpio_probe(struct pci_dev *pdev,
u32 irq_base;
u32 gpio_base;
int retval = 0;
int ngpio = id->driver_data;

retval = pci_enable_device(pdev);
if (retval)
Expand Down Expand Up @@ -344,8 +345,15 @@ static int __devinit lnw_gpio_probe(struct pci_dev *pdev,
retval = -ENOMEM;
goto err3;
}

retval = irq_alloc_descs(-1, irq_base, ngpio, 0);
if (retval < 0) {
dev_err(&pdev->dev, "can't allocate IRQ descs\n");
goto err3;
}
lnw->irq_base = retval;

lnw->reg_base = base;
lnw->irq_base = irq_base;
lnw->chip.label = dev_name(&pdev->dev);
lnw->chip.request = lnw_gpio_request;
lnw->chip.direction_input = lnw_gpio_direction_input;
Expand All @@ -354,14 +362,14 @@ static int __devinit lnw_gpio_probe(struct pci_dev *pdev,
lnw->chip.set = lnw_gpio_set;
lnw->chip.to_irq = lnw_gpio_to_irq;
lnw->chip.base = gpio_base;
lnw->chip.ngpio = id->driver_data;
lnw->chip.ngpio = ngpio;
lnw->chip.can_sleep = 0;
lnw->pdev = pdev;
pci_set_drvdata(pdev, lnw);
retval = gpiochip_add(&lnw->chip);
if (retval) {
dev_err(&pdev->dev, "langwell gpiochip_add error %d\n", retval);
goto err3;
goto err4;
}
irq_set_handler_data(pdev->irq, lnw);
irq_set_chained_handler(pdev->irq, lnw_irq_handler);
Expand All @@ -378,6 +386,8 @@ static int __devinit lnw_gpio_probe(struct pci_dev *pdev,

return 0;

err4:
irq_free_descs(lnw->irq_base, ngpio);
err3:
pci_release_regions(pdev);
err2:
Expand Down

0 comments on commit ce90872

Please sign in to comment.