Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296898
b: refs/heads/master
c: 2d9dd99
h: refs/heads/master
v: v3
  • Loading branch information
Benoit Cousson authored and Samuel Ortiz committed Mar 22, 2012
1 parent 110f2c9 commit 65c6947
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 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: 364cedb2f97063d649b2950c099883b89b60c000
refs/heads/master: 2d9dd99b4470a2ef05509435465e055f50456330
33 changes: 17 additions & 16 deletions trunk/drivers/gpio/gpio-twl4030.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,23 +395,26 @@ static int gpio_twl4030_remove(struct platform_device *pdev);
static int __devinit gpio_twl4030_probe(struct platform_device *pdev)
{
struct twl4030_gpio_platform_data *pdata = pdev->dev.platform_data;
int ret;
int ret, irq_base;

/* maybe setup IRQs */
if (pdata->irq_base) {
if (is_module()) {
dev_err(&pdev->dev,
"can't dispatch IRQs from modules\n");
goto no_irqs;
}
ret = twl4030_sih_setup(&pdev->dev, TWL4030_MODULE_GPIO,
pdata->irq_base);
if (ret < 0)
return ret;
WARN_ON(ret != pdata->irq_base);
twl4030_gpio_irq_base = ret;
if (is_module()) {
dev_err(&pdev->dev, "can't dispatch IRQs from modules\n");
goto no_irqs;
}

irq_base = irq_alloc_descs(-1, 0, TWL4030_GPIO_MAX, 0);
if (irq_base < 0) {
dev_err(&pdev->dev, "Failed to alloc irq_descs\n");
return irq_base;
}

ret = twl4030_sih_setup(&pdev->dev, TWL4030_MODULE_GPIO, irq_base);
if (ret < 0)
return ret;

twl4030_gpio_irq_base = irq_base;

no_irqs:
/*
* NOTE: boards may waste power if they don't set pullups
Expand Down Expand Up @@ -443,9 +446,7 @@ static int __devinit gpio_twl4030_probe(struct platform_device *pdev)

ret = gpiochip_add(&twl_gpiochip);
if (ret < 0) {
dev_err(&pdev->dev,
"could not register gpiochip, %d\n",
ret);
dev_err(&pdev->dev, "could not register gpiochip, %d\n", ret);
twl_gpiochip.ngpio = 0;
gpio_twl4030_remove(pdev);
} else if (pdata->setup) {
Expand Down

0 comments on commit 65c6947

Please sign in to comment.