Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3972076pxb; Tue, 25 Jan 2022 00:19:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3KvHWQlsh0QmMLNPxPTxUsRCdNw64dB1TD/WaazJr1I0czQGJF+X5GmxcRLTPJNpZCi1E X-Received: by 2002:a17:902:b718:b0:14a:66e:979 with SMTP id d24-20020a170902b71800b0014a066e0979mr17775602pls.92.1643098777881; Tue, 25 Jan 2022 00:19:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643098777; cv=none; d=google.com; s=arc-20160816; b=vzqvRDl5LH7ztRIyziptJBRRrJbydIBHiwmeVJswd2a0oxg9K3MBvpFB8W2Ycj0/wD wpobFizFFapoINadGAgyY+lktTp4MTHFuKZV80YEwjujV4Cd/0bpgrDH8TZRM1k6Q3Zn b+5+tMs3gDYnZbFrmHbRGnbQd77dcyfr1zyOXAA6/i1iL8ouCITuRt5bEBc699fyP1GB pMBet+ZkNkFU2FCedvmmKsT5ltifl3Vzg6BnJeYZ+CC44Fx1Mx6FlycDecvBwTEMsx7H sF4Rc/WvM1P0lMkCqOoYK/pHXsnKe6bmAXpCmO9u8OGB7dgWnNvXmhosS/52kmDIZAEC QGzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VdZzvL4MiS9nw25oI6brN11dqk0CwW+dKlsa5QdHtoQ=; b=Z3k0E5cY3JkhyzPu/YTYiQw/97d8xk3qqq7J9lVx0UdC/iSVa2rnsLK5hgC3JtDySk 5FnxcoLKG25kvyf6zFL+0W/Kj5X5EDOSh3hxO4aaJmgG6PlC5fwCrIxiSJe3wcWImyBs aJwRIJoMfU3SxCasjFSnfAnYfJ4gsiiCj1thS60ZxfZXO6OGn7KpLjlavZPmjEfElEVv 2Fgkyhdjg9x7XEPCwEmWisCpFJNJgl9zmOA6/VqcP3Jd935xp3Q5g6iAi8WY0cTRa7L5 REFt7S9Na+Isu2HqIXiYdXPrLsDvMSPiqEgfWFBFcW9R2qc3bqJHL0pxbVqzriTRnzNB iiQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y4sPFk93; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n1si18108522plc.226.2022.01.25.00.19.26; Tue, 25 Jan 2022 00:19:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y4sPFk93; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S3413390AbiAYAi5 (ORCPT + 99 others); Mon, 24 Jan 2022 19:38:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2364010AbiAXXqc (ORCPT ); Mon, 24 Jan 2022 18:46:32 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FE70C0617A8; Mon, 24 Jan 2022 13:41:30 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 48029B81233; Mon, 24 Jan 2022 21:41:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73B20C340E4; Mon, 24 Jan 2022 21:41:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060488; bh=RU9LPponh3x6LDCbLu8EQDIpjKNBT5b5AgJqXCNloFs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y4sPFk93mlJ9DxmxIxBnAHY1e0J8/FmqqbDVPQZFs1Ed72rOPbGPaj5CsL7i2Uovn dMehCfw2KatUHKlUbRHsLwYw1XLTJAYZVwltmzXzQ9E4oit50+xk7oE+ibEzDVk9Y+ jj+CSAIEyF5xRSAKjWPyImGmOS/30xoQjFDYHe8E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Linus Walleij , Bartosz Golaszewski Subject: [PATCH 5.16 0964/1039] gpio: mpc8xxx: Fix IRQ check in mpc8xxx_probe Date: Mon, 24 Jan 2022 19:45:53 +0100 Message-Id: <20220124184157.689790247@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqian Lin commit 0b39536cc699db6850c426db7f9cb45923de40c5 upstream. platform_get_irq() returns negative error number instead 0 on failure. And the doc of platform_get_irq() provides a usage example: int irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; Fix the check of return value to catch errors correctly. Fixes: 76c47d1449fc ("gpio: mpc8xxx: Add ACPI support") Signed-off-by: Miaoqian Lin Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman --- drivers/gpio/gpio-mpc8xxx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/gpio/gpio-mpc8xxx.c +++ b/drivers/gpio/gpio-mpc8xxx.c @@ -388,8 +388,8 @@ static int mpc8xxx_probe(struct platform } mpc8xxx_gc->irqn = platform_get_irq(pdev, 0); - if (!mpc8xxx_gc->irqn) - return 0; + if (mpc8xxx_gc->irqn < 0) + return mpc8xxx_gc->irqn; mpc8xxx_gc->irq = irq_domain_create_linear(fwnode, MPC8XXX_GPIO_PINS,