From patchwork Fri Nov 23 12:56:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 13158 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 EA2E923EFB for ; Fri, 23 Nov 2012 12:56:34 +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 89897A18707 for ; Fri, 23 Nov 2012 12:56:34 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so1769457ieb.11 for ; Fri, 23 Nov 2012 04:56:34 -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=aqEngdat73kL8Fy8fjKUP9DQHTJGk0zS5Xgpihk1qlw=; b=iFqNJsYvxEQM3FYrnbsCv5Cjaq05+w9OCD06XJa9va8n3yAPa1k0k1YnZMGOeE415w s3jLDhotmfZi1O7cIUJ6EJ4IsE0krnl6ngkwBZWpGDeJrakdA6oZXogUjQxCJem/l7+8 KtkWxzeptl9XMPYpQnMZzW+2yt6Dg4j3QcCfSK0cbm+GcWfRiVG0bgebpkTdgkxmIfvV qAxftV88e87gjXB5C6hRt50vYgz6KMkLFiRJznnRIv0auUhv0tO5PQ24TeHFsdQR3EKH 9kADzIqxj2lUYIRcBZMQx9JSFNLGuLOvBY9cASzdeKUCfTW4CVUDefJwIeqw2YHsuLdI mv8w== Received: by 10.50.161.169 with SMTP id xt9mr5923409igb.62.1353675393992; Fri, 23 Nov 2012 04:56:33 -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 n20csp348040igt; Fri, 23 Nov 2012 04:56:33 -0800 (PST) Received: by 10.180.86.7 with SMTP id l7mr6101422wiz.5.1353675392735; Fri, 23 Nov 2012 04:56:32 -0800 (PST) Received: from mail-we0-f170.google.com (mail-we0-f170.google.com [74.125.82.170]) by mx.google.com with ESMTPS id s3si5792875wiw.11.2012.11.23.04.56.32 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 04:56:32 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.170 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.170; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.170 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-we0-f170.google.com with SMTP id r1so1029728wey.29 for ; Fri, 23 Nov 2012 04:56:32 -0800 (PST) Received: by 10.180.88.99 with SMTP id bf3mr6024738wib.22.1353675392080; Fri, 23 Nov 2012 04:56:32 -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 dd4sm9494668wib.2.2012.11.23.04.56.30 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 04:56:31 -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 Subject: [PATCH 1/1] mfd: Simplify IRQ domain registration code in STMPE Date: Fri, 23 Nov 2012 12:56:26 +0000 Message-Id: <1353675386-6749-1-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQnwq8NYyNIdOmmlFxcDq+ULCMX1aoMGchGs2pD7hatWG4jI48AfeZ6QpyJXePGdiWIfLBSQ 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. Samuel Ortiz 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;