Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308771
b: refs/heads/master
c: 6712419
h: refs/heads/master
i:
  308769: d29ee5e
  308767: 950624b
v: v3
  • Loading branch information
Peter Ujfalusi authored and Samuel Ortiz committed May 20, 2012
1 parent 4badcf2 commit 608ea3a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 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: 68029c6cf9750ff0d4ed5c812a3755cbd855862a
refs/heads/master: 6712419d697851c4472cdfd2111c844d777472e8
3 changes: 1 addition & 2 deletions trunk/drivers/mfd/twl6040-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ static int __devinit twl6040_probe(struct i2c_client *client,
}

/* In order to operate correctly we need valid interrupt config */
if (!client->irq || !pdata->irq_base) {
if (!client->irq) {
dev_err(&client->dev, "Invalid IRQ configuration\n");
return -EINVAL;
}
Expand Down Expand Up @@ -552,7 +552,6 @@ static int __devinit twl6040_probe(struct i2c_client *client,

twl6040->dev = &client->dev;
twl6040->irq = client->irq;
twl6040->irq_base = pdata->irq_base;

mutex_init(&twl6040->mutex);
mutex_init(&twl6040->io_mutex);
Expand Down
13 changes: 11 additions & 2 deletions trunk/drivers/mfd/twl6040-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/err.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/mfd/core.h>
Expand Down Expand Up @@ -138,7 +139,7 @@ static irqreturn_t twl6040_irq_thread(int irq, void *data)

int twl6040_irq_init(struct twl6040 *twl6040)
{
int i, nr_irqs, ret;
int i, nr_irqs, irq_base, ret;
u8 val;

mutex_init(&twl6040->irq_mutex);
Expand All @@ -149,8 +150,16 @@ int twl6040_irq_init(struct twl6040 *twl6040)
twl6040_reg_write(twl6040, TWL6040_REG_INTMR, TWL6040_ALLINT_MSK);

nr_irqs = ARRAY_SIZE(twl6040_irqs);

irq_base = irq_alloc_descs(-1, 0, nr_irqs, 0);
if (IS_ERR_VALUE(irq_base)) {
dev_err(twl6040->dev, "Fail to allocate IRQ descs\n");
return irq_base;
}
twl6040->irq_base = irq_base;

/* Register them with genirq */
for (i = twl6040->irq_base; i < twl6040->irq_base + nr_irqs; i++) {
for (i = irq_base; i < irq_base + nr_irqs; i++) {
irq_set_chip_data(i, twl6040);
irq_set_chip_and_handler(i, &twl6040_irq_chip,
handle_level_irq);
Expand Down

0 comments on commit 608ea3a

Please sign in to comment.