From patchwork Wed Jan 2 13:40:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13765 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 8DE6D23EC8 for ; Wed, 2 Jan 2013 13:40:32 +0000 (UTC) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by fiordland.canonical.com (Postfix) with ESMTP id 23FBFA1890C for ; Wed, 2 Jan 2013 13:40:32 +0000 (UTC) Received: by mail-vc0-f179.google.com with SMTP id p1so14453902vcq.10 for ; Wed, 02 Jan 2013 05:40:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :mime-version:content-type:x-gm-message-state; bh=RLmBYG19/lyIT1xbwDnM3FI7pbhH80NwdwonqpUJg2A=; b=msN5jfWjC7fyxViw7R2KSeIeMajpYxXgPLf3uGttHkrQi01SUueKoHJa9Z87e64yLJ fbxddK4h6jJUIAtngJ+tX2qH7C1dWCfB6Pm1Ec6z2T9zfYhDELBQt1OLugIyvFqAG7dr vwUaapG/lsvkzlXmw7Ph8gTytaWpLLPvz0NlJGF0j7XlYWmUZDGUjHqYiv2s9Jq88Th3 YAS6E2BL8xsjSR+dBG1pRD3I+0Vvb6gu2s1NapBgmfLcfNp2uFMmbYqSXwkyL+NKOmJj 3k6dm34jDypMjnVcjPlVEA9D0PC9drNhd16Eq6wXQAWxLDi8kk7MSV0rkbMxTFclBV9p l3jg== X-Received: by 10.220.8.18 with SMTP id f18mr68625562vcf.14.1357134031613; Wed, 02 Jan 2013 05:40:31 -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.58.145.101 with SMTP id st5csp45965veb; Wed, 2 Jan 2013 05:40:30 -0800 (PST) X-Received: by 10.14.215.194 with SMTP id e42mr125784494eep.32.1357134030221; Wed, 02 Jan 2013 05:40:30 -0800 (PST) Received: from eu1sys200aog113.obsmtp.com (eu1sys200aog113.obsmtp.com [207.126.144.135]) by mx.google.com with SMTP id g47si118133242eep.39.2013.01.02.05.40.26 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Jan 2013 05:40:30 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.135 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.135; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.135 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob113.postini.com ([207.126.147.11]) with SMTP ID DSNKUOQ4yELn8rFPH0oV+lm4CSxrbBCirjWA@postini.com; Wed, 02 Jan 2013 13:40:30 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A0661174; Wed, 2 Jan 2013 13:40:20 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 11E2D49B0; Wed, 2 Jan 2013 13:40:20 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 78F83A8065; Wed, 2 Jan 2013 14:40:14 +0100 (CET) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 2 Jan 2013 14:40:19 +0100 From: Linus Walleij To: Samuel Ortiz , Cc: Anmar Oueja , Linus Walleij , Subject: [PATCH v2] mfd: tc3589x: use simple irqdomain Date: Wed, 2 Jan 2013 14:40:14 +0100 Message-ID: <1357134014-31203-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnfLxS0NouJFJCH0CtoVSyLcl5vS63Ijg8tgJ34IEgAZzZknEm7UFIF0BcbmpjMfZ2f45BE This fixes a regression in the TC3589x driver introduced in commit 15e27b1088245a2de3b7d09d39cd209212eb16af "mfd: Provide the tc3589x with its own IRQ domain" If a system with a TC3589x expander is booted and a base IRQ is passed from platform data, a legacy domain will be used. However, since the Ux500 is now switched to use SPARSE_IRQ, no descriptors get allocated on-the-fly, and we get a crash. Fix this by switching to using the simple irqdomain that will handle this uniformly and also allocates descriptors explicitly. Also fix two small whitespace errors in the vicinity while we're at it. Cc: stable@kernel.org Acked-by: Lee Jones Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Update commit message after comments from Lee, add ACK, no changes to the patche per se. Hi Sam, this should go into the fixes for stable unless issues are found, it fixes a regression for us. --- drivers/mfd/tc3589x.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c index a06d66b..ecc092c 100644 --- a/drivers/mfd/tc3589x.c +++ b/drivers/mfd/tc3589x.c @@ -219,25 +219,18 @@ static void tc3589x_irq_unmap(struct irq_domain *d, unsigned int virq) } static struct irq_domain_ops tc3589x_irq_ops = { - .map = tc3589x_irq_map, + .map = tc3589x_irq_map, .unmap = tc3589x_irq_unmap, - .xlate = irq_domain_xlate_twocell, + .xlate = irq_domain_xlate_twocell, }; static int tc3589x_irq_init(struct tc3589x *tc3589x, struct device_node *np) { int base = tc3589x->irq_base; - if (base) { - tc3589x->domain = irq_domain_add_legacy( - NULL, TC3589x_NR_INTERNAL_IRQS, base, - 0, &tc3589x_irq_ops, tc3589x); - } - else { - tc3589x->domain = irq_domain_add_linear( - np, TC3589x_NR_INTERNAL_IRQS, - &tc3589x_irq_ops, tc3589x); - } + tc3589x->domain = irq_domain_add_simple( + np, TC3589x_NR_INTERNAL_IRQS, base, + &tc3589x_irq_ops, tc3589x); if (!tc3589x->domain) { dev_err(tc3589x->dev, "Failed to create irqdomain\n");