From patchwork Fri Nov 23 15:19:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 13163 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 34D1723FCD for ; Fri, 23 Nov 2012 15:19:36 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 82F2DA19513 for ; Fri, 23 Nov 2012 15:19:35 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so1943492ieb.11 for ; Fri, 23 Nov 2012 07:19:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=l97qeBwnb6iOyxxwGBzzaw1dXfuukIpG9l6+16lxSsM=; b=VRb2Tn1cQdZ/iPWkbGyLAOaX70vpOZVYHBVidCMegt1kxW8Aviwis5+S1APTbYhrrP +z4woiIF1oQtIN2ENI/LR1hJNvALujU97XhzdBVquqAt90QKY8VF/yIXPob8A4AOj3f8 kbczrBfpgb4dnUqxnp9zXzqG7/p6nfKZcs4sPM3G7ato+QsLMAkT8i0AB2NDf+c5xH2B 6sqUs37s2bU87v6o80hK1tftyN7mtSjxJPwrqJktKyiwK3ZAvzxy42WxFHOJfxX8bYjz iCXXvjGAXVsVCl7ZdpQI07k+pt2TZYbmSW4oWICu5yYkuDq/gUFpM/9PpxZwuI13oi1V Y8jw== Received: by 10.50.213.69 with SMTP id nq5mr6359318igc.70.1353683975287; Fri, 23 Nov 2012 07:19:35 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp366760igt; Fri, 23 Nov 2012 07:19:34 -0800 (PST) Received: by 10.180.94.169 with SMTP id dd9mr10241023wib.14.1353683974117; Fri, 23 Nov 2012 07:19:34 -0800 (PST) Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by mx.google.com with ESMTPS id l22si3642411weo.113.2012.11.23.07.19.33 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 07:19:34 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.44 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.44; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.44 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wg0-f44.google.com with SMTP id dr13so676423wgb.1 for ; Fri, 23 Nov 2012 07:19:33 -0800 (PST) Received: by 10.180.92.132 with SMTP id cm4mr10261499wib.12.1353683973595; Fri, 23 Nov 2012 07:19:33 -0800 (PST) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id r10sm10042161wiz.0.2012.11.23.07.19.31 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 07:19:32 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, viresh.kumar@linaro.org, Lee Jones , Samuel Ortiz Subject: [PATCH 1/1] mfd: Simplify IRQ domain registration code in STMPE Date: Fri, 23 Nov 2012 15:19:29 +0000 Message-Id: <1353683969-9332-1-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQnIIKp+cpYNCH5xj/IPn+9/eG2/dYTuhocLJ2BNl9WfkPVfDrtL1h1G/Hd6KJ3IfDfXFgfF 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. Cc: Samuel Ortiz Reviewed-by: Viresh Kumar Signed-off-by: Lee Jones --- drivers/mfd/stmpe.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c index b03cc64..0e6d8b8 100644 --- a/drivers/mfd/stmpe.c +++ b/drivers/mfd/stmpe.c @@ -889,18 +889,14 @@ static struct irq_domain_ops stmpe_irq_ops = { static int __devinit stmpe_irq_init(struct stmpe *stmpe, struct device_node *np) { - int base = stmpe->irq_base; + int base = 0; int num_irqs = stmpe->variant->num_irqs; - if (base) { - stmpe->domain = irq_domain_add_legacy( - np, num_irqs, base, 0, &stmpe_irq_ops, stmpe); - } - else { - stmpe->domain = irq_domain_add_linear( - np, num_irqs, &stmpe_irq_ops, stmpe); - } + if (!np) + base = stmpe->irq_base; + stmpe->domain = irq_domain_add_simple(np, num_irqs, base, + &stmpe_irq_ops, stmpe); if (!stmpe->domain) { dev_err(stmpe->dev, "Failed to create irqdomain\n"); return -ENOSYS;