Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6:
mfd: twl4030 irq fixes

+24 -31
+24 -31
drivers/mfd/twl4030-irq.c
··· 180 static int twl4030_irq_thread(void *data) 181 { 182 long irq = (long)data; 183 - struct irq_desc *desc = irq_to_desc(irq); 184 static unsigned i2c_errors; 185 static const unsigned max_i2c_errors = 100; 186 187 - if (!desc) { 188 - pr_err("twl4030: Invalid IRQ: %ld\n", irq); 189 - return -EINVAL; 190 - } 191 192 current->flags |= PF_NOFREEZE; 193 ··· 235 } 236 local_irq_enable(); 237 238 - desc->chip->unmask(irq); 239 } 240 241 return 0; ··· 250 * thread. All we do here is acknowledge and mask the interrupt and wakeup 251 * the kernel thread. 252 */ 253 - static void handle_twl4030_pih(unsigned int irq, struct irq_desc *desc) 254 { 255 /* Acknowledge, clear *AND* mask the interrupt... */ 256 - desc->chip->ack(irq); 257 - complete(&irq_event); 258 } 259 - 260 - static struct task_struct *start_twl4030_irq_thread(long irq) 261 - { 262 - struct task_struct *thread; 263 - 264 - init_completion(&irq_event); 265 - thread = kthread_run(twl4030_irq_thread, (void *)irq, "twl4030-irq"); 266 - if (!thread) 267 - pr_err("twl4030: could not create irq %ld thread!\n", irq); 268 - 269 - return thread; 270 - } 271 - 272 /*----------------------------------------------------------------------*/ 273 274 /* ··· 717 } 718 719 /* install an irq handler to demultiplex the TWL4030 interrupt */ 720 - task = start_twl4030_irq_thread(irq_num); 721 - if (!task) { 722 - pr_err("twl4030: irq thread FAIL\n"); 723 - status = -ESRCH; 724 - goto fail; 725 } 726 727 - set_irq_data(irq_num, task); 728 - set_irq_chained_handler(irq_num, handle_twl4030_pih); 729 - 730 return status; 731 - 732 fail: 733 for (i = irq_base; i < irq_end; i++) 734 set_irq_chip_and_handler(i, NULL, NULL);
··· 180 static int twl4030_irq_thread(void *data) 181 { 182 long irq = (long)data; 183 static unsigned i2c_errors; 184 static const unsigned max_i2c_errors = 100; 185 186 187 current->flags |= PF_NOFREEZE; 188 ··· 240 } 241 local_irq_enable(); 242 243 + enable_irq(irq); 244 } 245 246 return 0; ··· 255 * thread. All we do here is acknowledge and mask the interrupt and wakeup 256 * the kernel thread. 257 */ 258 + static irqreturn_t handle_twl4030_pih(int irq, void *devid) 259 { 260 /* Acknowledge, clear *AND* mask the interrupt... */ 261 + disable_irq_nosync(irq); 262 + complete(devid); 263 + return IRQ_HANDLED; 264 } 265 /*----------------------------------------------------------------------*/ 266 267 /* ··· 734 } 735 736 /* install an irq handler to demultiplex the TWL4030 interrupt */ 737 + 738 + 739 + init_completion(&irq_event); 740 + 741 + status = request_irq(irq_num, handle_twl4030_pih, IRQF_DISABLED, 742 + "TWL4030-PIH", &irq_event); 743 + if (status < 0) { 744 + pr_err("twl4030: could not claim irq%d: %d\n", irq_num, status); 745 + goto fail_rqirq; 746 } 747 748 + task = kthread_run(twl4030_irq_thread, (void *)irq_num, "twl4030-irq"); 749 + if (IS_ERR(task)) { 750 + pr_err("twl4030: could not create irq %d thread!\n", irq_num); 751 + status = PTR_ERR(task); 752 + goto fail_kthread; 753 + } 754 return status; 755 + fail_kthread: 756 + free_irq(irq_num, &irq_event); 757 + fail_rqirq: 758 + /* clean up twl4030_sih_setup */ 759 fail: 760 for (i = irq_base; i < irq_end; i++) 761 set_irq_chip_and_handler(i, NULL, NULL);