From patchwork Fri Mar 2 16:28:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 10255123 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 09C43603ED for ; Fri, 2 Mar 2018 16:28:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE0A12896A for ; Fri, 2 Mar 2018 16:28:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E291728A29; Fri, 2 Mar 2018 16:28:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24D93289D5 for ; Fri, 2 Mar 2018 16:28:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935860AbeCBQ21 (ORCPT ); Fri, 2 Mar 2018 11:28:27 -0500 Received: from foss.arm.com ([217.140.101.70]:57758 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932746AbeCBQ20 (ORCPT ); Fri, 2 Mar 2018 11:28:26 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EC9E51529; Fri, 2 Mar 2018 08:28:25 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E80703F24A; Fri, 2 Mar 2018 08:28:23 -0800 (PST) Date: Fri, 2 Mar 2018 16:28:21 +0000 From: Mark Rutland To: Russell King - ARM Linux Cc: Dan Carpenter , linux-samsung-soc@vger.kernel.org, Wolfram Sang , linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Kukjin Kim , linux-i2c@vger.kernel.org, Ben Dooks , stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] i2c: s3c2410: Properly handle interrupts of number 0 Message-ID: <20180302162821.bmsxgrqqaginjooo@lakrids.cambridge.arm.com> References: <1519936484-23132-1-git-send-email-krzk@kernel.org> <20180302111931.GX9418@n2100.armlinux.org.uk> <20180302124647.sfhnto77wgdh5sv6@katana> <20180302125907.GA9418@n2100.armlinux.org.uk> <20180302135854.76ue5jzsg7lvxjxw@katana> <20180302140901.lrjqiaa2k4nxkqco@mwanda> <20180302153221.GB9418@n2100.armlinux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180302153221.GB9418@n2100.armlinux.org.uk> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Mar 02, 2018 at 03:32:22PM +0000, Russell King - ARM Linux wrote: > How do we break this status quo and finally solve the IRQ 0 and > NO_IRQ issue? > Another possibility would be to change platform_get_irq() and > suffer the regressions that will cause, telling people that fixing > their platform IRQ numbering is the only solution (but this > requires breaking our ideals about regressions.) How about we start with a warning? That'll be visible, but shouldn't result in broken systems while we wait for people to fix things up. e.g. something like the below. Mark. ---->8---- --- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/base/platform.c b/drivers/base/platform.c index f1bf7b38d91c..bd42eeffd2aa 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -126,7 +126,12 @@ int platform_get_irq(struct platform_device *dev, unsigned int num) irqd_set_trigger_type(irqd, r->flags & IORESOURCE_BITS); } - return r ? r->start : -ENXIO; + if (!r) + return -ENXIO; + + WARN_ONCE(!r->start, "Platform uses zero as a valid IRQ."); + + return r->start; #endif } EXPORT_SYMBOL_GPL(platform_get_irq);