From patchwork Fri Dec 17 18:15:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12696721 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03C78C433F5 for ; Fri, 17 Dec 2021 18:44:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ELaW4+Lw0KAwRjQdq1ZIP27NCTeQAeamfpQSsiovYr8=; b=oH+Adb4Zs4f/CK Y5ee2xGMnLQB0o2wEoo3grwlq/MmqYX1N6+N78HhIHZqBxTAeZFj6as1EEX+zrgIQX2B8B6Lv/drv Ce5LqtyZBP0zpU6MjnEZfCePckoNXbO61AeOiKEQAHQ/k9AdlpnEkDVstET9uOmBA5Sf+Fyy6aNNx kAAkZove+vE963bXH1Wjrhck0bb4ystbxzRIoZJH0RBGy/G6GHa2zKPly8NXozUoZlRJjj73ANGG+ ikEE9pPuCSDAwqr1UD2bwM+eu7sXU1ypi/m2BlPxmePRoIh+0HMhjuJG+VVvUBz5wQ5NfjkcFhswW h62orG4JlDOtAWopCqEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1myIC6-00BwHf-TC; Fri, 17 Dec 2021 18:43:03 +0000 Received: from mga06.intel.com ([134.134.136.31]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1myHlj-00BjzP-PO; Fri, 17 Dec 2021 18:15:49 +0000 X-IronPort-AV: E=McAfee;i="6200,9189,10201"; a="300580626" X-IronPort-AV: E=Sophos;i="5.88,214,1635231600"; d="scan'208";a="300580626" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Dec 2021 10:15:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,214,1635231600"; d="scan'208";a="466593784" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 17 Dec 2021 10:15:44 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id B0728109; Fri, 17 Dec 2021 20:15:51 +0200 (EET) From: Andy Shevchenko To: Zhiyong Tao , Andy Shevchenko , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby , Matthias Brugger Subject: [PATCH v2 1/1] serial: 8520_mtk: Prepare for platform_get_irq_optional() changes Date: Fri, 17 Dec 2021 20:15:47 +0200 Message-Id: <20211217181547.48182-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211217_101547_927962_FF95C972 X-CRM114-Status: GOOD ( 14.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The platform_get_irq_optional() is going to be changed in a way that the result of it: = 0 means no IRQ is provided < 0 means the error which needs to be propagated to the upper layers > 0 valid vIRQ is allocated In this case, drop check for 0. Note, the 0 is not valid vIRQ and platform_get_irq_optional() issues a big WARN() in such case, It's safe to assume that 0 is not valid IRQ in this case since the driver is only instantiated via Device Tree and corresponding OF APIs should never ever return 0 for valid IRQ. Otherwise it is a regression there. Signed-off-by: Andy Shevchenko --- v2: explained why it's safe to assume 0 is not valid here (Greg) drivers/tty/serial/8250/8250_mtk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c index fb65dc601b23..328ab074fd89 100644 --- a/drivers/tty/serial/8250/8250_mtk.c +++ b/drivers/tty/serial/8250/8250_mtk.c @@ -621,7 +621,7 @@ static int __maybe_unused mtk8250_suspend(struct device *dev) serial8250_suspend_port(data->line); pinctrl_pm_select_sleep_state(dev); - if (irq >= 0) { + if (irq > 0) { err = enable_irq_wake(irq); if (err) { dev_err(dev, @@ -641,7 +641,7 @@ static int __maybe_unused mtk8250_resume(struct device *dev) struct mtk8250_data *data = dev_get_drvdata(dev); int irq = data->rx_wakeup_irq; - if (irq >= 0) + if (irq > 0) disable_irq_wake(irq); pinctrl_pm_select_default_state(dev);