Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp977691pxb; Wed, 6 Apr 2022 05:52:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLF7hHWKcLz6WAXcrU6QvNTp5wWLPmdv7AhCLAHnLl8uQYVHm/DSIYaJVf/PfUuXZ8T+YJ X-Received: by 2002:a65:538f:0:b0:382:b4d:bdd8 with SMTP id x15-20020a65538f000000b003820b4dbdd8mr6982560pgq.262.1649249563439; Wed, 06 Apr 2022 05:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649249563; cv=none; d=google.com; s=arc-20160816; b=iKmcDqPXKgOfPBEwEPPc+lJL3d3kGHNLUWYIxF0P2BX5KRH1L5O0+fxvJY85DR7YWp 9NJrN7l/4rbdMcGM+GdofaRpZ6N58HoBv93Ry+3rTjCjkBDJJIUgxK84DZMDZxSMxlXj X9S4fpQRvT3bsQHpFBVl5hrOP3Kf01zI3TFCxorJogZ/lZzz3o5koTGBSFXU2DfrMouK KOlCvGgn4SNlKVP/i8w39UV2cSgyewSv56SGObRo+6dKD+uGlvsy4WQNCbeOCAp9T1mY v5cuzzP9FTi7SCdcxEgfWryXTp3S2zMFIbI1jSSvebFfzmPb3WysHZyhcDwwLqEy6ya3 Kugg== 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=nbEMiEpi+4rATZaEBTzSH6W5FqcisHVNyEzEz9jAd6g=; b=YJp1C6+rgcBo5JQ2NCLrRrSIpdW4Rl901AlJgK2koKrE54cnH8xmXCQhFhg3e0SXvg EugpI1OP3+h8WT/KIGjpOhcOlqigUCGDD07lb5KPrNfxZRVACbKAm54aUtY7LbKG1rhb 723Yh5GkqrboMaYPToad86cbV3DtsfITTwHP22m8BTys6pUO5wZZ4DEUCfrY3cuIHGI4 /SiOlegEEYIg2yyEnVfFxJgum561AUyIP0W0QfLnyvwAthUQXkobZEmw0xzyM1GTX/0d LuI2BnLCECdiCdvDxILsHTt5kQogR7rImybpFmguZvy9YnjkdzRrQFusS5REYSYkc9RG 0CIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=M1Lo6Znu; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b10-20020a170903228a00b00156abe4e643si9021870plh.81.2022.04.06.05.52.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:52:43 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=M1Lo6Znu; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4C474419D82; Wed, 6 Apr 2022 02:49:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390897AbiDEUGZ (ORCPT + 99 others); Tue, 5 Apr 2022 16:06:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349021AbiDEJs6 (ORCPT ); Tue, 5 Apr 2022 05:48:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C55712631; Tue, 5 Apr 2022 02:39:06 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 135A461368; Tue, 5 Apr 2022 09:39:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 274A1C385A2; Tue, 5 Apr 2022 09:39:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151545; bh=GRVYjGN0oVU3bLQLZkS30dh2b8ueNqwEcosPDjmYZFA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M1Lo6Znu/ouZ9sNfz/A+fsNa+6SHi0H42B9nXn8p257+2jhwFwdRdOvO1bjxyzpLq 8zh0WlSPgcHw2fkL1pHPiU7Js9Z2h30uu6CtKnouLn/cS8sv4uoB2O7XQbs3pFUhV3 z8j9lVLD4rUriU3JzHQxyJAC071mjxbXqnnDtfBE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Linus Walleij , Sebastian Reichel , Sasha Levin Subject: [PATCH 5.15 416/913] power: reset: gemini-poweroff: Fix IRQ check in gemini_poweroff_probe Date: Tue, 5 Apr 2022 09:24:38 +0200 Message-Id: <20220405070352.316647422@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqian Lin [ Upstream commit ba18dad0fb880cd29aa97b6b75560ef14d1061ba ] 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: f7a388d6cd1c ("power: reset: Add a driver for the Gemini poweroff") Signed-off-by: Miaoqian Lin Reviewed-by: Linus Walleij Signed-off-by: Sebastian Reichel Signed-off-by: Sasha Levin --- drivers/power/reset/gemini-poweroff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/reset/gemini-poweroff.c b/drivers/power/reset/gemini-poweroff.c index 90e35c07240a..b7f7a8225f22 100644 --- a/drivers/power/reset/gemini-poweroff.c +++ b/drivers/power/reset/gemini-poweroff.c @@ -107,8 +107,8 @@ static int gemini_poweroff_probe(struct platform_device *pdev) return PTR_ERR(gpw->base); irq = platform_get_irq(pdev, 0); - if (!irq) - return -EINVAL; + if (irq < 0) + return irq; gpw->dev = dev; -- 2.34.1