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 180 static int twl4030_irq_thread(void *data) 181 181 { 182 182 long irq = (long)data; 183 - struct irq_desc *desc = irq_to_desc(irq); 184 183 static unsigned i2c_errors; 185 184 static const unsigned max_i2c_errors = 100; 186 185 187 - if (!desc) { 188 - pr_err("twl4030: Invalid IRQ: %ld\n", irq); 189 - return -EINVAL; 190 - } 191 186 192 187 current->flags |= PF_NOFREEZE; 193 188 ··· 235 240 } 236 241 local_irq_enable(); 237 242 238 - desc->chip->unmask(irq); 243 + enable_irq(irq); 239 244 } 240 245 241 246 return 0; ··· 250 255 * thread. All we do here is acknowledge and mask the interrupt and wakeup 251 256 * the kernel thread. 252 257 */ 253 - static void handle_twl4030_pih(unsigned int irq, struct irq_desc *desc) 258 + static irqreturn_t handle_twl4030_pih(int irq, void *devid) 254 259 { 255 260 /* Acknowledge, clear *AND* mask the interrupt... */ 256 - desc->chip->ack(irq); 257 - complete(&irq_event); 261 + disable_irq_nosync(irq); 262 + complete(devid); 263 + return IRQ_HANDLED; 258 264 } 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 265 /*----------------------------------------------------------------------*/ 273 266 274 267 /* ··· 717 734 } 718 735 719 736 /* 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; 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; 725 746 } 726 747 727 - set_irq_data(irq_num, task); 728 - set_irq_chained_handler(irq_num, handle_twl4030_pih); 729 - 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 + } 730 754 return status; 731 - 755 + fail_kthread: 756 + free_irq(irq_num, &irq_event); 757 + fail_rqirq: 758 + /* clean up twl4030_sih_setup */ 732 759 fail: 733 760 for (i = irq_base; i < irq_end; i++) 734 761 set_irq_chip_and_handler(i, NULL, NULL);