From patchwork Fri Jun 3 08:23:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaoqian Lin X-Patchwork-Id: 12868793 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 32B37C43334 for ; Fri, 3 Jun 2022 08:25:07 +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:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=OmB5zx7LRDuRmKZIR2xgrHOfFYU+Gx3pj0OKlm3bduM=; b=21A0E4DxoRNR+X YwWNcKor5D5nVb2WcqoNp3zvxKoR86BpJLT3voMgE+Qlpgk2fxkmkaln4eLhcYRXo1JgDco8Unkdf qjiOXV8nXBX1grTk2Y9s9TKyIG1Jnh76Jr47hBM867v7wQAcpHZpSfceLtmDrVtbVM4uvlUNwdEHC 5ZydJf0/yUqFFKRqrV+By9sMFiQcMV/TXf55vzRdjH4s+VR4BPboyqoiXCcamWP5e5HPTtgGPScux 5/YgL83o1IONkOhN+XsjHd/UsVFMa9bCtgmcybUmCXkTv9669jRAPAbl2JWBLJlYsMFOg726eer2Q ElzRxQDRBBrAFoXu+NPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nx2b1-006dim-Rc; Fri, 03 Jun 2022 08:23:51 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nx2ay-006di5-DO for linux-arm-kernel@lists.infradead.org; Fri, 03 Jun 2022 08:23:49 +0000 Received: by mail-pj1-x1034.google.com with SMTP id n10so6858197pjh.5 for ; Fri, 03 Jun 2022 01:23:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=DJ5nOCm8LzcOFMf8dnh/CUtYdPr3TKZePHvPE4Ct0MA=; b=TQjaqSnDFwGyupFW9eoFjOll0k72uxMIxfGVm2AnhrSZWe7ATloGVFkY/cUNwu9zbB w+C3i3HZQj0Ef5OMvLZujyOCLFcT0WtZwF9GuDLv/4/b87zEiPUgEC4MjNGBRQcjqXBM qzTZf31kKRrt34/KjGtbwFh9iwp5i/fRcVMiZGqUMfTamVNZh0yslWC8OFrQYDtWeXv8 +Zq2w5wMmnXNq4/K5qG05hBPfKzIxjlP4YMIj2P2weEsabq7s2hzW8KbQ9pySx94I+kQ MB7Jtlm0Os8as7/uuRCsrTgI8/13atDyU2wJJmTMx0FU/EL7RZ1vbtcLjUcIdegBY44K /N1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=DJ5nOCm8LzcOFMf8dnh/CUtYdPr3TKZePHvPE4Ct0MA=; b=EBxQ9urV5N6axRXk5hCOtN+h09JyWmp8WtXdHDDCkw+b32myBJUuKRb3Aec/fu5p0k PxRyH8umf6/Jl8RCE8Dq0UcVSwQQAfePg7nA3s2oxFPGECCCcjGsC59RskKahezPFbCp 1MBWitfUn21lJHVTWKpCBF38SYypqYkzT2wHNmc/n1FOi+dgjc0k+TDDDAjWOaag69jO Rydgk9LPo77ezqpjwsbgufSuG+wxub/bcP6zQ7FwDzvR8+FIruW3EFdnL3YysVbO6MIG IAwYk2a3zyZE0qkSEkZDmi9eyP3TEjTd/R2LW3pTd0QdsQQAQFWbnJFnjqHND4l4xFzG 1IWw== X-Gm-Message-State: AOAM530P2ZC5b3us5wj8rxZTZjpZQBMkonnrntgtNAnY9rp4QnXXKwCr AVnBb7inEmmI9jVCprEaey4= X-Google-Smtp-Source: ABdhPJwG680KUxCoYDSbUUqPJzsbyeO7F8Mz29YiJl6SmAvepgPoKkwAgxs7y83lsE1ERiQwCAv7jQ== X-Received: by 2002:a17:902:8d87:b0:162:da7:e3d6 with SMTP id v7-20020a1709028d8700b001620da7e3d6mr9212233plo.44.1654244626465; Fri, 03 Jun 2022 01:23:46 -0700 (PDT) Received: from localhost.localdomain ([202.120.234.246]) by smtp.googlemail.com with ESMTPSA id ju10-20020a17090b20ca00b001df264610c4sm4818881pjb.0.2022.06.03.01.23.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 01:23:45 -0700 (PDT) From: Miaoqian Lin To: Joel Stanley , Andrew Jeffery , Patrick Venture , Chia-Wei Wang , Miaoqian Lin , Arnd Bergmann , Olof Johansson , linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH] soc: aspeed: Fix IRQ check in aspeed_lpc_snoop_config_irq Date: Fri, 3 Jun 2022 12:23:34 +0400 Message-Id: <20220603082336.3867-1-linmq006@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220603_012348_488258_4A320971 X-CRM114-Status: GOOD ( 13.32 ) 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 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: 524feb799408 ("soc: add aspeed folder and misc drivers") Signed-off-by: Miaoqian Lin --- Link: https://lore.kernel.org/r/20220114064357.18562-1-linmq006@gmail.com In previous thread: Reviewed-by: Chia-Wei Wang Signed-off-by: Patrick Venture --- drivers/soc/aspeed/aspeed-lpc-snoop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/aspeed/aspeed-lpc-snoop.c b/drivers/soc/aspeed/aspeed-lpc-snoop.c index eceeaf8dfbeb..c4a03b3a5cf8 100644 --- a/drivers/soc/aspeed/aspeed-lpc-snoop.c +++ b/drivers/soc/aspeed/aspeed-lpc-snoop.c @@ -167,8 +167,8 @@ static int aspeed_lpc_snoop_config_irq(struct aspeed_lpc_snoop *lpc_snoop, int rc; lpc_snoop->irq = platform_get_irq(pdev, 0); - if (!lpc_snoop->irq) - return -ENODEV; + if (lpc_snoop->irq < 0) + return lpc_snoop->irq; rc = devm_request_irq(dev, lpc_snoop->irq, aspeed_lpc_snoop_irq, IRQF_SHARED,