From patchwork Fri Sep 7 11:14:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 11248 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 6981723F25 for ; Fri, 7 Sep 2012 11:15:39 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id C2F80A19633 for ; Fri, 7 Sep 2012 11:15:38 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id j25so2861152iaf.11 for ; Fri, 07 Sep 2012 04:15:38 -0700 (PDT) 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:in-reply-to:references :x-gm-message-state; bh=YycYicGroalYlwFQKbLAdsPN89adrxkDgz6rjRB0QLo=; b=ZwbcVnnmJ8/e3Um8vch4aOARBQ1Y52Zv8cqkJi4H7QjyPUOqc6ptmiAyfZUYE5VaPi WOgFigebTKGHl/uuc3svc2+kFO6+0509GMY5DWLwplG54SmocILIg3GIcpvAX9iZhmWg kC+bwRh6Pk1DkfVixiZR7h5DLTvDEckzstAoVGMm1yGwF44q70LSSrAH+dRLA0cAtLPj 4tjwl594NhAI88H1jVaGLCE2OTJ33C+jsNQMsRK4yt/26zaV8AQyTJQFqoPadzKF4F27 6p6C6TEyMVASx80yJ2MT9Zfe/vxbM/jmIJk9pOFA3nh6mg0GAWvI7DGYu8Qr5jT3V5vg uBPA== Received: by 10.50.180.129 with SMTP id do1mr8107913igc.28.1347016538584; Fri, 07 Sep 2012 04:15:38 -0700 (PDT) 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.184.232 with SMTP id ex8csp373460igc; Fri, 7 Sep 2012 04:15:37 -0700 (PDT) Received: by 10.180.104.200 with SMTP id gg8mr11536287wib.14.1347016537114; Fri, 07 Sep 2012 04:15:37 -0700 (PDT) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id fj1si12702359wib.21.2012.09.07.04.15.36 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 07 Sep 2012 04:15:37 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.50 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-f50.google.com with SMTP id ds11so2271205wgb.31 for ; Fri, 07 Sep 2012 04:15:36 -0700 (PDT) Received: by 10.217.2.146 with SMTP id p18mr3128687wes.224.1347016536581; Fri, 07 Sep 2012 04:15:36 -0700 (PDT) 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 k20sm9151505wiv.11.2012.09.07.04.15.35 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 07 Sep 2012 04:15:36 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: STEricsson_nomadik_linux@list.st.com, linus.walleij@stericsson.com, arnd@arndb.de, Lee Jones , Samuel Ortiz Subject: [PATCH 15/19] mfd: Don't convert just one IRQ using irqdomain if a range is provided Date: Fri, 7 Sep 2012 12:14:55 +0100 Message-Id: <1347016499-29354-16-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1347016499-29354-1-git-send-email-lee.jones@linaro.org> References: <1347016499-29354-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQkaGACyS/J8eqObNkWbvSeJsN5P/6jE/TlNjA/Amr+vF3aXpAO/m+0FSf67fD+p0XlGr7Vx MFD core code attempts to convert specified hardware (local) IRQ numbers to virtual-IRQs, which something Linux can understand. This works great when only one IRQ is specified. However, converting entire ranges is currently unsupported. If this occurs we issue a kernel warning to inform the user of this, but we continue to convert the first specified IRQ anyway and replace the range. This is not the correct behaviour. This patch ensures that if a range is specified, it is left untouched. CC: Samuel Ortiz Signed-off-by: Lee Jones --- drivers/mfd/mfd-core.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index f8b7771..f07cf69 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -126,10 +126,12 @@ static int mfd_add_device(struct device *parent, int id, } else if (cell->resources[r].flags & IORESOURCE_IRQ) { if (domain) { /* Unable to create mappings for IRQ ranges. */ - WARN_ON(cell->resources[r].start != - cell->resources[r].end); - res[r].start = res[r].end = irq_create_mapping( - domain, cell->resources[r].start); + if (!WARN_ON(cell->resources[r].start != + cell->resources[r].end)) + res[r].start = res[r].end = + irq_create_mapping( + domain, + cell->resources[r].start); } else { res[r].start = irq_base + cell->resources[r].start;