From patchwork Wed Dec 2 06:10:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 551192 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-wm0-x23f.google.com (mail-wm0-x23f.google.com [IPv6:2a00:1450:400c:c09::23f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BB3E31401DA for ; Wed, 2 Dec 2015 17:10:35 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b=H39ZeZBa; dkim-atps=neutral Received: by wmec201 with SMTP id c201sf13225325wme.1 for ; Tue, 01 Dec 2015 22:10:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:from:to:cc:subject:date:message-id:x-original-sender :x-original-authentication-results:reply-to:content-type:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:sender:list-subscribe:list-unsubscribe; bh=TOHlUd+QgaxCpFZHwV8/TQNLP3uPTCUysdlKgYwVGq8=; b=H39ZeZBajaj/UQJGUFxlPwFO9GH7WI44H5LgPNCgUBmuVqQRRPJupOqqRJOmDRsIaw 16CwULnYzSZcipbQq8m/rm3dowyuvMaPiQQ2n9KCeGViWCD+YGYpDWkagJRJ8uEC4jUy qPJW51jZIc9X/4HrbC3xisFzB/y9Pq0UVlhrgCr2NU7Cm3PpH1mIWI/yqnBac3zf/QEr uIrDxuz620hOX3CYdnqu0Lkpsh5tsAb90BDDIyYYJO6ODpwelFhDZ1e/NC2tHQZ6GbZx N6XW12GgbUIMn2IpgU2TtUGHcXMm0REyZJYhvyHqPs0FeHC1pQvBG/Yvn4BUsAfHA1F+ 2x+w== X-Received: by 10.25.21.227 with SMTP id 96mr9658lfv.7.1449036631637; Tue, 01 Dec 2015 22:10:31 -0800 (PST) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.25.149.136 with SMTP id x130ls114687lfd.51.gmail; Tue, 01 Dec 2015 22:10:30 -0800 (PST) X-Received: by 10.112.140.200 with SMTP id ri8mr119007lbb.23.1449036630926; Tue, 01 Dec 2015 22:10:30 -0800 (PST) Received: from mail.mleia.com (mleia.com. [178.79.152.223]) by gmr-mx.google.com with ESMTPS id b62si45561wmc.0.2015.12.01.22.10.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Dec 2015 22:10:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of vz@mleia.com designates 178.79.152.223 as permitted sender) client-ip=178.79.152.223; Received: from mail.mleia.com (localhost [127.0.0.1]) by mail.mleia.com (Postfix) with ESMTP id 84C273C2; Wed, 2 Dec 2015 06:12:18 +0000 (GMT) From: Vladimir Zapolskiy To: Alessandro Zummo , Alexandre Belloni Cc: rtc-linux@googlegroups.com Subject: [rtc-linux] [PATCH] rtc: lpc32xx: remove irq > NR_IRQS check from probe() Date: Wed, 2 Dec 2015 08:10:28 +0200 Message-Id: <1449036628-20539-1-git-send-email-vz@mleia.com> X-Mailer: git-send-email 2.1.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20151202_061218_566015_EEF5CFAA X-CRM114-Status: GOOD ( 17.09 ) X-Original-Sender: vz@mleia.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of vz@mleia.com designates 178.79.152.223 as permitted sender) smtp.mailfrom=vz@mleia.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: rtc-linux@googlegroups.com X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , If the driver is used on an ARM platform with SPARSE_IRQ defined, semantics of NR_IRQS is different (minimal value of virtual irqs) and by default it is set to 16, see arch/arm/include/asm/irq.h. This value may be less than the actual number of virtual irqs, which may break the driver initialization. The check removal allows to use the driver on such a platform, and, if irq controller driver works correctly, the check is not needed on legacy platforms. Fixes a runtime problem: rtc-lpc32xx 40024000.rtc: Can't get interrupt resource Signed-off-by: Vladimir Zapolskiy --- drivers/rtc/rtc-lpc32xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-lpc32xx.c b/drivers/rtc/rtc-lpc32xx.c index f923f73..887871c 100644 --- a/drivers/rtc/rtc-lpc32xx.c +++ b/drivers/rtc/rtc-lpc32xx.c @@ -205,7 +205,7 @@ static int lpc32xx_rtc_probe(struct platform_device *pdev) u32 tmp; rtcirq = platform_get_irq(pdev, 0); - if (rtcirq < 0 || rtcirq >= NR_IRQS) { + if (rtcirq < 0) { dev_warn(&pdev->dev, "Can't get interrupt resource\n"); rtcirq = -1; }