Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8559766ybl; Thu, 16 Jan 2020 19:36:00 -0800 (PST) X-Google-Smtp-Source: APXvYqz49XEeejUWZCYQnADxKM4jsbpjnkWx1+ektXDrFxM8FLvhZlx/M7pLl0CPRan4vOMJwYzX X-Received: by 2002:a9d:6b17:: with SMTP id g23mr4585856otp.265.1579232159915; Thu, 16 Jan 2020 19:35:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579232159; cv=none; d=google.com; s=arc-20160816; b=jfBGQbStXmcOHZ8B0c3h5CKIAEDIMrT6jhqs7W70EQjznoDnU3g6ysQ51ko/5Tbgyl b95tj0xz81D0klVSu9z2gkofDtb2HLRHP8XPvZzhA++STpgTFnooh90vocGWr0kq8eXX RTyglKyqmcUmx+pbkGWlMeEmvmRh0eEk1W6o2Ipbx5a+X+z+56krP0m7SeKRus3iGiYY QXbuhZ+7YghlH4kkLUfAHeKMBWUdRDc4Ix4JTBBb/4vuVZF0XhXEbyGXlIDH/1ImlSTF 9xYypz5R1hder0r8proSWjYuurSILb9x8lx0z0AbXMB2MsHMQNmiR1X934xJKPp9WK/4 +SFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=njRY+jBsDeBwVSmfbUrr5XHEEpD8WO6RkOoAWumw4sk=; b=ACdrhX+LslkF/7L0KCINTgbBifnzTpeHlgCj3bT+rcl5KicvZ1vms/LGOwE3fi5D/c LhQEhNeLcdjtUGQfOl7hnF3cqoN2517P7e3Pr1DcRtQfUT/Ea8QxBAiui1AESVheToIN FYWO7YFNmzGjE4Jl8JLXCJVH8MCQspkOECtVFJEIO1R85iFXnXOOeeV2igPx54jbfMNk 8UcyQo49mP38GHgmT2gJ3bnx/2XUYmI2TvZem8P/5OpzjIcRB5QGvHxbjuWsm8Ji2XCm UTWcxHhbf8m0cpn/cjaOGczhkDN/Dj6BJyHQdwX0f7WoGCvJAjoDx0/ASwynKFxdn/oY BK4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qep5xNjt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t142si12843902oih.242.2020.01.16.19.35.48; Thu, 16 Jan 2020 19:35:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qep5xNjt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389399AbgAPXn6 (ORCPT + 99 others); Thu, 16 Jan 2020 18:43:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:53694 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387656AbgAPXYe (ORCPT ); Thu, 16 Jan 2020 18:24:34 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D58B82075B; Thu, 16 Jan 2020 23:24:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217074; bh=s74q2vs0Pm/TZ/Gqkd/YCzfn1ZB1h0PHMDmLnjAnEsI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qep5xNjtq2oUruJqVZxqUrTy/Ebs1uL0c2x1rI3uJwitnvCya67/1pb0SEr0wIaoJ LO20obMR3uZRdNR/xqT8kkqI/BWcnYIZipwIWpHoj46ffgkhmNFoBRHMt4K3ZUjGYw XPWravIG1Ec6GvISIFqwhTeIcln+zDhykxZs9x2Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Geert Uytterhoeven , Yoshihiro Shimoda , Stephen Boyd , =?UTF-8?q?Niklas=20S=C3=B6derlund?= Subject: [PATCH 5.4 121/203] pinctrl: sh-pfc: Do not use platform_get_irq() to count interrupts Date: Fri, 17 Jan 2020 00:17:18 +0100 Message-Id: <20200116231755.888490098@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231745.218684830@linuxfoundation.org> References: <20200116231745.218684830@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Geert Uytterhoeven commit ad7fe1a1a35994a201497443b5140bf54b074cca upstream. As platform_get_irq() now prints an error when the interrupt does not exist, counting interrupts by looping until failure causes the printing of scary messages like: sh-pfc e6060000.pin-controller: IRQ index 0 not found Fix this by using the platform_irq_count() helper instead. Fixes: 7723f4c5ecdb8d83 ("driver core: platform: Add an error message to platform_get_irq*()") Signed-off-by: Geert Uytterhoeven Reviewed-by: Yoshihiro Shimoda Reviewed-by: Stephen Boyd Reviewed-by: Niklas Söderlund Tested-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20191016142601.28255-1-geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman --- drivers/pinctrl/sh-pfc/core.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) --- a/drivers/pinctrl/sh-pfc/core.c +++ b/drivers/pinctrl/sh-pfc/core.c @@ -29,12 +29,12 @@ static int sh_pfc_map_resources(struct sh_pfc *pfc, struct platform_device *pdev) { - unsigned int num_windows, num_irqs; struct sh_pfc_window *windows; unsigned int *irqs = NULL; + unsigned int num_windows; struct resource *res; unsigned int i; - int irq; + int num_irqs; /* Count the MEM and IRQ resources. */ for (num_windows = 0;; num_windows++) { @@ -42,17 +42,13 @@ static int sh_pfc_map_resources(struct s if (!res) break; } - for (num_irqs = 0;; num_irqs++) { - irq = platform_get_irq(pdev, num_irqs); - if (irq == -EPROBE_DEFER) - return irq; - if (irq < 0) - break; - } - if (num_windows == 0) return -EINVAL; + num_irqs = platform_irq_count(pdev); + if (num_irqs < 0) + return num_irqs; + /* Allocate memory windows and IRQs arrays. */ windows = devm_kcalloc(pfc->dev, num_windows, sizeof(*windows), GFP_KERNEL);