Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217533
b: refs/heads/master
c: 8a233f0
h: refs/heads/master
i:
  217531: 9167261
v: v3
  • Loading branch information
Alek Du authored and Linus Torvalds committed Oct 26, 2010
1 parent 50b45c3 commit a3575e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 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: 2e85c4ddd3f32d3e1da51f4129473399e505ffa3
refs/heads/master: 8a233f01b7d7dd587f85fa581274f168f1e88bb8
13 changes: 7 additions & 6 deletions trunk/drivers/gpio/pca953x.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)

do {
level = __ffs(pending);
handle_nested_irq(level + chip->irq_base);
generic_handle_irq(level + chip->irq_base);

pending &= ~(1 << level);
} while (pending);
Expand All @@ -360,7 +360,8 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
struct pca953x_platform_data *pdata = client->dev.platform_data;
int ret;

if (pdata->irq_base && (id->driver_data & PCA953X_INT)) {
if (pdata->irq_base != -1
&& (id->driver_data & PCA953X_INT)) {
int lvl;

ret = pca953x_read_reg(chip, PCA953X_INPUT,
Expand All @@ -383,7 +384,6 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
set_irq_chip_data(irq, chip);
set_irq_chip_and_handler(irq, &pca953x_irq_chip,
handle_edge_irq);
set_irq_nested_thread(irq, 1);
#ifdef CONFIG_ARM
set_irq_flags(irq, IRQF_VALID);
#else
Expand All @@ -394,6 +394,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
ret = request_threaded_irq(client->irq,
NULL,
pca953x_irq_handler,
IRQF_TRIGGER_RISING |
IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
dev_name(&client->dev), chip);
if (ret) {
Expand All @@ -408,13 +409,13 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
return 0;

out_failed:
chip->irq_base = 0;
chip->irq_base = -1;
return ret;
}

static void pca953x_irq_teardown(struct pca953x_chip *chip)
{
if (chip->irq_base)
if (chip->irq_base != -1)
free_irq(chip->client->irq, chip);
}
#else /* CONFIG_GPIO_PCA953X_IRQ */
Expand All @@ -424,7 +425,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
struct i2c_client *client = chip->client;
struct pca953x_platform_data *pdata = client->dev.platform_data;

if (pdata->irq_base && (id->driver_data & PCA953X_INT))
if (pdata->irq_base != -1 && (id->driver_data & PCA953X_INT))
dev_warn(&client->dev, "interrupt support not compiled in\n");

return 0;
Expand Down

0 comments on commit a3575e1

Please sign in to comment.