aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2012-11-23 10:19:29 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2012-11-26 06:11:21 -0500
commitb20a43715e675815d0a426f05a7607ba099136aa (patch)
tree84dce3b2e8cb8ffa127406fd7a603692667b6b46
parent3f9be35bd9090eaa2f68ed9b24efdbf3abcf4b28 (diff)
mfd: Simplify IRQ domain registration code in STMPE
Historically, a driver would have to decide whether it required a Linear or Legacy IRQ domain when registering one. This can end up as quite a lot of code. A new Simple call now exists which simplifies this process. Let's make use of it here. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/mfd/stmpe.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index c0df4b9d51c3..0061d1bc9719 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -888,18 +888,14 @@ static struct irq_domain_ops stmpe_irq_ops = {
888static int __devinit stmpe_irq_init(struct stmpe *stmpe, 888static int __devinit stmpe_irq_init(struct stmpe *stmpe,
889 struct device_node *np) 889 struct device_node *np)
890{ 890{
891 int base = stmpe->irq_base; 891 int base = 0;
892 int num_irqs = stmpe->variant->num_irqs; 892 int num_irqs = stmpe->variant->num_irqs;
893 893
894 if (base) { 894 if (!np)
895 stmpe->domain = irq_domain_add_legacy( 895 base = stmpe->irq_base;
896 np, num_irqs, base, 0, &stmpe_irq_ops, stmpe);
897 }
898 else {
899 stmpe->domain = irq_domain_add_linear(
900 np, num_irqs, &stmpe_irq_ops, stmpe);
901 }
902 896
897 stmpe->domain = irq_domain_add_simple(np, num_irqs, base,
898 &stmpe_irq_ops, stmpe);
903 if (!stmpe->domain) { 899 if (!stmpe->domain) {
904 dev_err(stmpe->dev, "Failed to create irqdomain\n"); 900 dev_err(stmpe->dev, "Failed to create irqdomain\n");
905 return -ENOSYS; 901 return -ENOSYS;