12bb79
From patchwork Wed Oct  2 14:43:18 2019
12bb79
Content-Type: text/plain; charset="utf-8"
12bb79
MIME-Version: 1.0
12bb79
Content-Transfer-Encoding: 7bit
12bb79
X-Patchwork-Submitter: Thierry Reding <thierry.reding@gmail.com>
12bb79
X-Patchwork-Id: 11171225
12bb79
Return-Path: 
12bb79
 <SRS0=hIqC=X3=lists.infradead.org=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@kernel.org>
12bb79
Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
12bb79
 [172.30.200.123])
12bb79
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C771E1747
12bb79
	for <patchwork-linux-arm@patchwork.kernel.org>;
12bb79
 Wed,  2 Oct 2019 14:45:14 +0000 (UTC)
12bb79
Received: from bombadil.infradead.org (bombadil.infradead.org
12bb79
 [198.137.202.133])
12bb79
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
12bb79
	(No client certificate requested)
12bb79
	by mail.kernel.org (Postfix) with ESMTPS id 9703B21D81
12bb79
	for <patchwork-linux-arm@patchwork.kernel.org>;
12bb79
 Wed,  2 Oct 2019 14:45:14 +0000 (UTC)
12bb79
Authentication-Results: mail.kernel.org;
12bb79
	dkim=pass (2048-bit key) header.d=lists.infradead.org
12bb79
 header.i=@lists.infradead.org header.b="LCP5OdWP";
12bb79
	dkim=fail reason="signature verification failed" (2048-bit key)
12bb79
 header.d=gmail.com header.i=@gmail.com header.b="ahoJ80fO"
12bb79
DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9703B21D81
12bb79
Authentication-Results: mail.kernel.org;
12bb79
 dmarc=fail (p=none dis=none) header.from=gmail.com
12bb79
Authentication-Results: mail.kernel.org;
12bb79
 spf=none
12bb79
 smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
12bb79
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
12bb79
	d=lists.infradead.org; s=bombadil.20170209; h=Sender:
12bb79
	Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:
12bb79
	List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To
12bb79
	:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:
12bb79
	Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:
12bb79
	List-Owner; bh=csIWPoJz7RR9msf1imaCNOLXiDPcaRmxRKjOL8gMaXM=; b=LCP5OdWPpIBxJz
12bb79
	tSNffGBZI2pwLSarAvmqKIowLW5LghNe3CVQh7HM3sIR+IqrUtTSXi/0EEQAQORrYHSnR4zrDlubl
12bb79
	8IIqIetbgOrEmYRpHQxWZV/Z0p5JTdvNVeOiR63CuFbjz/h9UXPWOiLZijU1eZfSN2UuEJWxzoWMF
12bb79
	CsXxW+3rZ3os8AAa9x0lt6gGLwAPEPrxP44q4AJTVp3q+cD7GTXHu0F2ZT2flxES+cFF2/cPg2GiM
12bb79
	yR5j7GNMDhdxFKjGp8qcDhfCKx/0jF0DofnC4JsVlN0R25HdwYHzdHhysk8ca7JxLIMJlgXsgM5aY
12bb79
	4XUIEB/0CjoPtdbP+8yw==;
12bb79
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
12bb79
	by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux))
12bb79
	id 1iFfsO-0006Nf-SR; Wed, 02 Oct 2019 14:45:12 +0000
12bb79
Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443])
12bb79
 by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux))
12bb79
 id 1iFfqd-0003rK-EL
12bb79
 for linux-arm-kernel@lists.infradead.org; Wed, 02 Oct 2019 14:43:47 +0000
12bb79
Received: by mail-wr1-x443.google.com with SMTP id w12so19991081wro.5
12bb79
 for <linux-arm-kernel@lists.infradead.org>;
12bb79
 Wed, 02 Oct 2019 07:43:21 -0700 (PDT)
12bb79
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
12bb79
 h=from:to:cc:subject:date:message-id:mime-version
12bb79
 :content-transfer-encoding;
12bb79
 bh=y9l/1MkRoZLCyZNPXaR5fzwvTbuyIzYA20JLtWuhYR4=;
12bb79
 b=ahoJ80fONPxwQPqvbuQRAba40syj0YJFK3SbqTxd0FOzhs1n3WTvNd/gHQ+2WK5WwB
12bb79
 8joqipXveUGBgePR1RwHR0oQyDAumewRmSMStvhyCHPeo154CNqZfGQNlbNlRng2QJqd
12bb79
 1/Sq8GNJ1DjcLifpHWbCC9LoK5U3UkvdIWHPFx0cqJ+ENvPHkYPr2FdpaZ8jxuJta3TT
12bb79
 dplkNk0AsL/tc33KBJbKUSlnYppX878WQXUvnhdB+TRmr5R3dtc5Ewc0TH4h7V1SXTly
12bb79
 GiNnbbCc+BKzzqk9PTo/Pqf5dzWcpNDBA1GUkzQZDTXOXXUzBjnlrTaQctjSdE6meWfJ
12bb79
 JbDw==
12bb79
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
12bb79
 d=1e100.net; s=20161025;
12bb79
 h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version
12bb79
 :content-transfer-encoding;
12bb79
 bh=y9l/1MkRoZLCyZNPXaR5fzwvTbuyIzYA20JLtWuhYR4=;
12bb79
 b=m4CouDn44ioMScPU+9h/V5vlxCAt0m4CSZKRu3pcsThkHE6u1TeKieaoBr1mh1qnIv
12bb79
 YS+V9Cd7osJa8R8USg+SJkEaSSarOn4kUq2MPTgMMmvKb63SSCCs0QD44nwEBAjIgMd/
12bb79
 /akFUOMTGQBnN7P8Iq3KWI00bVJLeoVWmqtQPkLFI1cIRrkCKTF4jh6b+i6xsiT8t2rd
12bb79
 l6WPsWnKkqUmPAqzpmLJ9bmSsiGBBFUexUJDcQnskkx6tTBzFhyNtpsbq6VdcY2mS3LR
12bb79
 rgGbisZRFdLvdZfGhmPX1hRgDoiHQLuWNAv49LtJtR7/CjNFmsKr4MBg1ydz0uO01Axr
12bb79
 zoIQ==
12bb79
X-Gm-Message-State: APjAAAXPZ9a+CEGZKeL6T+FXZoBRFrxryg3xujpPFnNpjznB8ehsaTI0
12bb79
 P6wL6cWqK9IRnS17Y/YRAb4=
12bb79
X-Google-Smtp-Source: 
12bb79
 APXvYqyETp8FIXhzzDrv+mhfzHhU0D9h3bcpLQ9oRbkEYPG7JvxLk5RVWx/ooYmku2+exI6oXsHTnA==
12bb79
X-Received: by 2002:a5d:4dd0:: with SMTP id f16mr2905889wru.85.1570027400467;
12bb79
 Wed, 02 Oct 2019 07:43:20 -0700 (PDT)
12bb79
Received: from localhost (p2E5BE2CE.dip0.t-ipconnect.de. [46.91.226.206])
12bb79
 by smtp.gmail.com with ESMTPSA id z125sm10251381wme.37.2019.10.02.07.43.19
12bb79
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
12bb79
 Wed, 02 Oct 2019 07:43:19 -0700 (PDT)
12bb79
From: Thierry Reding <thierry.reding@gmail.com>
12bb79
To: Lee Jones <lee.jones@linaro.org>
12bb79
Subject: [PATCH] mfd: max77620: Do not allocate IRQs upfront
12bb79
Date: Wed,  2 Oct 2019 16:43:18 +0200
12bb79
Message-Id: <20191002144318.140365-1-thierry.reding@gmail.com>
12bb79
X-Mailer: git-send-email 2.23.0
12bb79
MIME-Version: 1.0
12bb79
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
12bb79
X-CRM114-CacheID: sfid-20191002_074330_018855_CC323A91 
12bb79
X-CRM114-Status: GOOD (  11.81  )
12bb79
X-Spam-Score: -0.2 (/)
12bb79
X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary:
12bb79
 Content analysis details:   (-0.2 points)
12bb79
 pts rule name              description
12bb79
 ---- ----------------------
12bb79
 --------------------------------------------------
12bb79
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
12bb79
 no trust [2a00:1450:4864:20:0:0:0:443 listed in]
12bb79
 [list.dnswl.org]
12bb79
 -0.0 SPF_PASS               SPF: sender matches SPF record
12bb79
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
12bb79
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
12bb79
 provider (thierry.reding[at]gmail.com)
12bb79
 -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from
12bb79
 envelope-from domain
12bb79
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature,
12bb79
 not necessarily
12bb79
 valid
12bb79
 -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from
12bb79
 author's domain
12bb79
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
12bb79
X-BeenThere: linux-arm-kernel@lists.infradead.org
12bb79
X-Mailman-Version: 2.1.29
12bb79
Precedence: list
12bb79
List-Id: <linux-arm-kernel.lists.infradead.org>
12bb79
List-Unsubscribe: 
12bb79
 <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
12bb79
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
12bb79
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
12bb79
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
12bb79
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
12bb79
List-Subscribe: 
12bb79
 <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
12bb79
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
12bb79
Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org,
12bb79
 linux-arm-kernel@lists.infradead.org
12bb79
Content-Type: text/plain; charset="us-ascii"
12bb79
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
12bb79
Errors-To: 
12bb79
 linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
12bb79
12bb79
From: Thierry Reding <treding@nvidia.com>
12bb79
12bb79
regmap_add_irq_chip() will try to allocate all of the IRQ descriptors
12bb79
upfront if passed a non-zero irq_base parameter. However, the intention
12bb79
is to allocate IRQ descriptors on an as-needed basis if possible. Pass 0
12bb79
instead of -1 to fix that use-case.
12bb79
12bb79
Signed-off-by: Thierry Reding <treding@nvidia.com>
12bb79
---
12bb79
 drivers/mfd/max77620.c       | 5 ++---
12bb79
 include/linux/mfd/max77620.h | 1 -
12bb79
 2 files changed, 2 insertions(+), 4 deletions(-)
12bb79
12bb79
diff --git a/drivers/mfd/max77620.c b/drivers/mfd/max77620.c
12bb79
index a851ff473a44..c7ed5c353553 100644
12bb79
--- a/drivers/mfd/max77620.c
12bb79
+++ b/drivers/mfd/max77620.c
12bb79
@@ -507,7 +507,6 @@ static int max77620_probe(struct i2c_client *client,
12bb79
 
12bb79
 	i2c_set_clientdata(client, chip);
12bb79
 	chip->dev = &client->dev;
12bb79
-	chip->irq_base = -1;
12bb79
 	chip->chip_irq = client->irq;
12bb79
 	chip->chip_id = (enum max77620_chip_id)id->driver_data;
12bb79
 
12bb79
@@ -545,8 +544,8 @@ static int max77620_probe(struct i2c_client *client,
12bb79
 
12bb79
 	max77620_top_irq_chip.irq_drv_data = chip;
12bb79
 	ret = devm_regmap_add_irq_chip(chip->dev, chip->rmap, client->irq,
12bb79
-				       IRQF_ONESHOT | IRQF_SHARED,
12bb79
-				       chip->irq_base, &max77620_top_irq_chip,
12bb79
+				       IRQF_ONESHOT | IRQF_SHARED, 0,
12bb79
+				       &max77620_top_irq_chip,
12bb79
 				       &chip->top_irq_data);
12bb79
 	if (ret < 0) {
12bb79
 		dev_err(chip->dev, "Failed to add regmap irq: %d\n", ret);
12bb79
diff --git a/include/linux/mfd/max77620.h b/include/linux/mfd/max77620.h
12bb79
index 12ba157cb83f..f552ef5b1100 100644
12bb79
--- a/include/linux/mfd/max77620.h
12bb79
+++ b/include/linux/mfd/max77620.h
12bb79
@@ -329,7 +329,6 @@ struct max77620_chip {
12bb79
 	struct regmap *rmap;
12bb79
 
12bb79
 	int chip_irq;
12bb79
-	int irq_base;
12bb79
 
12bb79
 	/* chip id */
12bb79
 	enum max77620_chip_id chip_id;