aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/twl4030-irq.c
diff options
context:
space:
mode:
authorBenoit Cousson <b-cousson@ti.com>2012-03-02 05:11:26 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2012-03-22 08:05:34 -0400
commitec1a07b3440cc28946a77a974c21570bbef6ffa1 (patch)
treefc238f2f59f991678c67e15ad4d87ff0ed389d88 /drivers/mfd/twl4030-irq.c
parent5a903090e7aa561901b7f052eb744b480d6126d4 (diff)
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/twl4030-irq.c')
-rw-r--r--drivers/mfd/twl4030-irq.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
index 3b748b71c0f3..5d656e814358 100644
--- a/drivers/mfd/twl4030-irq.c
+++ b/drivers/mfd/twl4030-irq.c
@@ -32,7 +32,6 @@
32#include <linux/interrupt.h> 32#include <linux/interrupt.h>
33#include <linux/irq.h> 33#include <linux/irq.h>
34#include <linux/slab.h> 34#include <linux/slab.h>
35
36#include <linux/of.h> 35#include <linux/of.h>
37#include <linux/irqdomain.h> 36#include <linux/irqdomain.h>
38#include <linux/i2c/twl.h> 37#include <linux/i2c/twl.h>
@@ -639,14 +638,14 @@ int twl4030_sih_setup(struct device *dev, int module, int irq_base)
639 int status = -EINVAL; 638 int status = -EINVAL;
640 639
641 /* only support modules with standard clear-on-read for now */ 640 /* only support modules with standard clear-on-read for now */
642 for (sih_mod = 0, sih = sih_modules; 641 for (sih_mod = 0, sih = sih_modules; sih_mod < nr_sih_modules;
643 sih_mod < nr_sih_modules;
644 sih_mod++, sih++) { 642 sih_mod++, sih++) {
645 if (sih->module == module && sih->set_cor) { 643 if (sih->module == module && sih->set_cor) {
646 status = 0; 644 status = 0;
647 break; 645 break;
648 } 646 }
649 } 647 }
648
650 if (status < 0) 649 if (status < 0)
651 return status; 650 return status;
652 651
@@ -676,7 +675,7 @@ int twl4030_sih_setup(struct device *dev, int module, int irq_base)
676 status = request_threaded_irq(irq, NULL, handle_twl4030_sih, 0, 675 status = request_threaded_irq(irq, NULL, handle_twl4030_sih, 0,
677 agent->irq_name ?: sih->name, NULL); 676 agent->irq_name ?: sih->name, NULL);
678 677
679 pr_info("twl4030: %s (irq %d) chaining IRQs %d..%d\n", sih->name, 678 dev_info(dev, "%s (irq %d) chaining IRQs %d..%d\n", sih->name,
680 irq, irq_base, irq_base + i - 1); 679 irq, irq_base, irq_base + i - 1);
681 680
682 return status < 0 ? status : irq_base; 681 return status < 0 ? status : irq_base;
@@ -692,12 +691,10 @@ int twl4030_sih_setup(struct device *dev, int module, int irq_base)
692int twl4030_init_irq(struct device *dev, int irq_num) 691int twl4030_init_irq(struct device *dev, int irq_num)
693{ 692{
694 static struct irq_chip twl4030_irq_chip; 693 static struct irq_chip twl4030_irq_chip;
694 int status, i;
695 int irq_base, irq_end, nr_irqs; 695 int irq_base, irq_end, nr_irqs;
696 struct device_node *node = dev->of_node; 696 struct device_node *node = dev->of_node;
697 697
698 int status;
699 int i;
700
701 /* 698 /*
702 * TWL core and pwr interrupts must be contiguous because 699 * TWL core and pwr interrupts must be contiguous because
703 * the hwirqs numbers are defined contiguously from 1 to 15. 700 * the hwirqs numbers are defined contiguously from 1 to 15.
@@ -727,7 +724,7 @@ int twl4030_init_irq(struct device *dev, int irq_num)
727 twl4030_irq_base = irq_base; 724 twl4030_irq_base = irq_base;
728 725
729 /* 726 /*
730 * install an irq handler for each of the SIH modules; 727 * Install an irq handler for each of the SIH modules;
731 * clone dummy irq_chip since PIH can't *do* anything 728 * clone dummy irq_chip since PIH can't *do* anything
732 */ 729 */
733 twl4030_irq_chip = dummy_irq_chip; 730 twl4030_irq_chip = dummy_irq_chip;
@@ -742,13 +739,13 @@ int twl4030_init_irq(struct device *dev, int irq_num)
742 activate_irq(i); 739 activate_irq(i);
743 } 740 }
744 741
745 pr_info("twl4030: %s (irq %d) chaining IRQs %d..%d\n", "PIH", 742 dev_info(dev, "%s (irq %d) chaining IRQs %d..%d\n", "PIH",
746 irq_num, irq_base, irq_end); 743 irq_num, irq_base, irq_end);
747 744
748 /* ... and the PWR_INT module ... */ 745 /* ... and the PWR_INT module ... */
749 status = twl4030_sih_setup(dev, TWL4030_MODULE_INT, irq_end); 746 status = twl4030_sih_setup(dev, TWL4030_MODULE_INT, irq_end);
750 if (status < 0) { 747 if (status < 0) {
751 pr_err("twl4030: sih_setup PWR INT --> %d\n", status); 748 dev_err(dev, "sih_setup PWR INT --> %d\n", status);
752 goto fail; 749 goto fail;
753 } 750 }
754 751
@@ -757,7 +754,7 @@ int twl4030_init_irq(struct device *dev, int irq_num)
757 IRQF_ONESHOT, 754 IRQF_ONESHOT,
758 "TWL4030-PIH", NULL); 755 "TWL4030-PIH", NULL);
759 if (status < 0) { 756 if (status < 0) {
760 pr_err("twl4030: could not claim irq%d: %d\n", irq_num, status); 757 dev_err(dev, "could not claim irq%d: %d\n", irq_num, status);
761 goto fail_rqirq; 758 goto fail_rqirq;
762 } 759 }
763 760