Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8652174ybn; Tue, 1 Oct 2019 11:09:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnQhrLbs2ItAEnToD6J/S4X09sZIy72XKmZVcGDkDwhdevB+uo8sHmZgsr7k/g3oZleM4z X-Received: by 2002:aa7:c657:: with SMTP id z23mr27169055edr.234.1569953350180; Tue, 01 Oct 2019 11:09:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569953350; cv=none; d=google.com; s=arc-20160816; b=dIi79eAJJDor3WCwW6dY6rOK9IJztsUSqdDkTfKH7XbowKlJkZAC1/sts17jDoPOHS W1iZ3UvEcNvED8nBc1rPwUgUvH1qaYwC6IgGs1Mr2EWtrFQXwsw14owo4ZpInPT4aeRa RrmO8dacfXdUQSHU8ymrdPZ5/xXgvSHHm2m8Lbe95MgGDD0T2sgcc+oFSEWp+jzhgEpM lLPfCKsrezhbMNwuGkbqG2LwNPb7wJVAj0Wvs3DSk8yZZ/jGahkOELwYkfdv9PuBf+kf gMMDIuDtbs89xj9gDAJTdfk2LUfVQ/Ad8NkY/7JZtkmR/h4O75SJxgkLx/5xk31BpY26 IuWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=7N1/UPE9BGA8u7gvJrnqOdDoA/DMhdcVaiFJYeG205U=; b=OjjqQa4qVzLdyG2DdYvil1GM+H+BKJsmO8ZMUIb/N6eC469psMfWx1VJiiHSkjW0Pk zK6VPbsaob5yIkAGCDzCT1z51kQCnsVf0D9AYAUNJejCkffKtqHCkoXXOR6If2NYWM4e Jsq++ZHXCWmr6GfZMKPpdyq55/wWD1zMqiS4F84W4TEiM+EH8BWyN1jHRWkLRttg9Snr f2lB92ZaWppTbx7TboPgbgtoBDbn1/h+RUQL5cpPiaeUP036M6tdjSqSX/22NWdb1VJi e6/guQIL9ywG8z//X0ryHOg5uuC94w1wEK0LErQNvHbmvLn2n8sv0r2ZsmZ70eyeu9ix Q1kQ== ARC-Authentication-Results: i=1; mx.google.com; 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 c38si9797923eda.46.2019.10.01.11.08.45; Tue, 01 Oct 2019 11:09:10 -0700 (PDT) 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; 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 S1731777AbfJASFz (ORCPT + 99 others); Tue, 1 Oct 2019 14:05:55 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:48676 "EHLO baptiste.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727269AbfJASFz (ORCPT ); Tue, 1 Oct 2019 14:05:55 -0400 Received: from ramsan ([84.194.98.4]) by baptiste.telenet-ops.be with bizsmtp id 8J5t2100E05gfCL01J5th0; Tue, 01 Oct 2019 20:05:53 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1iFMX3-0008KP-4V; Tue, 01 Oct 2019 20:05:53 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1iFMX3-0000CZ-1z; Tue, 01 Oct 2019 20:05:53 +0200 From: Geert Uytterhoeven To: Linus Walleij Cc: Stephen Boyd , Greg Kroah-Hartman , linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] pinctrl: sh-pfc: Do not use platform_get_irq() to count interrupts Date: Tue, 1 Oct 2019 20:05:47 +0200 Message-Id: <20191001180547.734-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- This is a fix for v5.4-rc1. --- drivers/pinctrl/sh-pfc/core.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/pinctrl/sh-pfc/core.c b/drivers/pinctrl/sh-pfc/core.c index b8640ad41bef26be..ce983247c9e28bfe 100644 --- 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 sh_pfc *pfc, 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); -- 2.17.1