summaryrefslogtreecommitdiff
path: root/drivers/mfd/twl6030-irq.c
diff options
context:
space:
mode:
authorBenoit Cousson <b-cousson@ti.com>2012-03-02 14:11:26 +0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-03-22 16:05:34 +0400
commitec1a07b3440cc28946a77a974c21570bbef6ffa1 (patch)
treefc238f2f59f991678c67e15ad4d87ff0ed389d88 /drivers/mfd/twl6030-irq.c
parent5a903090e7aa561901b7f052eb744b480d6126d4 (diff)
downloadlinux-ec1a07b3440cc28946a77a974c21570bbef6ffa1.tar.xz
mfd: Replace twl-* pr_ macros by the dev_ equivalent and do various cleanups
Since a structure device is available now, use the dev_ macros instead of the pr_ ones. Clean some badly formatted comments. Remove some unused variables. Move some variable to the place they belong. Clean some badly wrapped lines. Align variable definition Add missing braces in if-then-else block. Add blank line for better readability. Move stuff here and there... Conflicts: drivers/mfd/twl-core.c Signed-off-by: Benoit Cousson <b-cousson@ti.com> Cc: Felipe Balbi <balbi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/twl6030-irq.c')
-rw-r--r--drivers/mfd/twl6030-irq.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c
index 86c4082fa411..b76902f1e44a 100644
--- a/drivers/mfd/twl6030-irq.c
+++ b/drivers/mfd/twl6030-irq.c
@@ -53,7 +53,6 @@
*
* We set up IRQs starting at a platform-specified base. An interrupt map table,
* specifies mapping between interrupt number and the associated module.
- *
*/
#define TWL6030_NR_IRQS 20
@@ -352,14 +351,11 @@ int twl6030_init_irq(struct device *dev, int irq_num)
{
struct device_node *node = dev->of_node;
int nr_irqs, irq_base, irq_end;
-
- int status = 0;
- int i;
struct task_struct *task;
- int ret;
- u8 mask[4];
-
- static struct irq_chip twl6030_irq_chip;
+ static struct irq_chip twl6030_irq_chip;
+ int status = 0;
+ int i;
+ u8 mask[4];
nr_irqs = TWL6030_NR_IRQS;
@@ -377,16 +373,18 @@ int twl6030_init_irq(struct device *dev, int irq_num)
mask[1] = 0xFF;
mask[2] = 0xFF;
mask[3] = 0xFF;
- ret = twl_i2c_write(TWL_MODULE_PIH, &mask[0],
- REG_INT_MSK_LINE_A, 3); /* MASK ALL INT LINES */
- ret = twl_i2c_write(TWL_MODULE_PIH, &mask[0],
- REG_INT_MSK_STS_A, 3); /* MASK ALL INT STS */
- ret = twl_i2c_write(TWL_MODULE_PIH, &mask[0],
- REG_INT_STS_A, 3); /* clear INT_STS_A,B,C */
+
+ /* mask all int lines */
+ twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_MSK_LINE_A, 3);
+ /* mask all int sts */
+ twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_MSK_STS_A, 3);
+ /* clear INT_STS_A,B,C */
+ twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_STS_A, 3);
twl6030_irq_base = irq_base;
- /* install an irq handler for each of the modules;
+ /*
+ * install an irq handler for each of the modules;
* clone dummy irq_chip since PIH can't *do* anything
*/
twl6030_irq_chip = dummy_irq_chip;
@@ -401,22 +399,22 @@ int twl6030_init_irq(struct device *dev, int irq_num)
activate_irq(i);
}
- pr_info("twl6030: %s (irq %d) chaining IRQs %d..%d\n", "PIH",
+ dev_info(dev, "PIH (irq %d) chaining IRQs %d..%d\n",
irq_num, irq_base, irq_end);
/* install an irq handler to demultiplex the TWL6030 interrupt */
init_completion(&irq_event);
- status = request_irq(irq_num, handle_twl6030_pih, 0,
- "TWL6030-PIH", &irq_event);
+ status = request_irq(irq_num, handle_twl6030_pih, 0, "TWL6030-PIH",
+ &irq_event);
if (status < 0) {
- pr_err("twl6030: could not claim irq%d: %d\n", irq_num, status);
+ dev_err(dev, "could not claim irq %d: %d\n", irq_num, status);
goto fail_irq;
}
task = kthread_run(twl6030_irq_thread, (void *)irq_num, "twl6030-irq");
if (IS_ERR(task)) {
- pr_err("twl6030: could not create irq %d thread!\n", irq_num);
+ dev_err(dev, "could not create irq %d thread!\n", irq_num);
status = PTR_ERR(task);
goto fail_kthread;
}
@@ -431,6 +429,7 @@ fail_kthread:
fail_irq:
for (i = irq_base; i < irq_end; i++)
irq_set_chip_and_handler(i, NULL, NULL);
+
return status;
}