aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2012-05-16 07:11:55 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-05-20 11:27:11 -0400
commit68029c6cf9750ff0d4ed5c812a3755cbd855862a (patch)
tree25ed8e9537b7392e497f25e94038a1d08cc0f99f /drivers/mfd
parent3690fb2ca5f4ecb9424d02598cb55d300f48d844 (diff)
mfd: twl6040 code cleanup in interrupt initialization part
No functional change, just to make the code a bit more uniform and remove wrapped lines. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/twl6040-irq.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/mfd/twl6040-irq.c b/drivers/mfd/twl6040-irq.c
index b3f8ddaa28a8..008022cdb06d 100644
--- a/drivers/mfd/twl6040-irq.c
+++ b/drivers/mfd/twl6040-irq.c
@@ -138,7 +138,7 @@ static irqreturn_t twl6040_irq_thread(int irq, void *data)
138 138
139int twl6040_irq_init(struct twl6040 *twl6040) 139int twl6040_irq_init(struct twl6040 *twl6040)
140{ 140{
141 int cur_irq, ret; 141 int i, nr_irqs, ret;
142 u8 val; 142 u8 val;
143 143
144 mutex_init(&twl6040->irq_mutex); 144 mutex_init(&twl6040->irq_mutex);
@@ -148,21 +148,20 @@ int twl6040_irq_init(struct twl6040 *twl6040)
148 twl6040->irq_masks_cache = TWL6040_ALLINT_MSK; 148 twl6040->irq_masks_cache = TWL6040_ALLINT_MSK;
149 twl6040_reg_write(twl6040, TWL6040_REG_INTMR, TWL6040_ALLINT_MSK); 149 twl6040_reg_write(twl6040, TWL6040_REG_INTMR, TWL6040_ALLINT_MSK);
150 150
151 nr_irqs = ARRAY_SIZE(twl6040_irqs);
151 /* Register them with genirq */ 152 /* Register them with genirq */
152 for (cur_irq = twl6040->irq_base; 153 for (i = twl6040->irq_base; i < twl6040->irq_base + nr_irqs; i++) {
153 cur_irq < twl6040->irq_base + ARRAY_SIZE(twl6040_irqs); 154 irq_set_chip_data(i, twl6040);
154 cur_irq++) { 155 irq_set_chip_and_handler(i, &twl6040_irq_chip,
155 irq_set_chip_data(cur_irq, twl6040);
156 irq_set_chip_and_handler(cur_irq, &twl6040_irq_chip,
157 handle_level_irq); 156 handle_level_irq);
158 irq_set_nested_thread(cur_irq, 1); 157 irq_set_nested_thread(i, 1);
159 158
160 /* ARM needs us to explicitly flag the IRQ as valid 159 /* ARM needs us to explicitly flag the IRQ as valid
161 * and will set them noprobe when we do so. */ 160 * and will set them noprobe when we do so. */
162#ifdef CONFIG_ARM 161#ifdef CONFIG_ARM
163 set_irq_flags(cur_irq, IRQF_VALID); 162 set_irq_flags(i, IRQF_VALID);
164#else 163#else
165 irq_set_noprobe(cur_irq); 164 irq_set_noprobe(i);
166#endif 165#endif
167 } 166 }
168 167