Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3351548rwb; Mon, 19 Sep 2022 20:29:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7XXLJwRc9OEA3wGPhRY6VNFYLqr/wjG9MPjBJG809ICupQmu2C1PNUCGbmx1jf5XzeS9Z3 X-Received: by 2002:a17:907:a0c7:b0:77c:d4ac:e8f1 with SMTP id hw7-20020a170907a0c700b0077cd4ace8f1mr14819092ejc.354.1663644562347; Mon, 19 Sep 2022 20:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663644562; cv=none; d=google.com; s=arc-20160816; b=nGW3/bBPqIl6SgHMcZkyyr5suL3+qLT6g0VRNczhh7FNOZuTI9+Pl9gw/fETlT3oGo SvPHMqFo3M1llh678PpNLPIqxq0NdcfoNztntKYMe0vmNsmbUYfF1QaSoyv7yRdE+qmP WVqdwESgDZBbe1oxsQRvNdY/h3BNgjg5WbM6RWCXgvSZ7B9akmyYHDEy1Daib60hhp6W YXFMSuswWsbyn07wOWBeBgBuj8nHYWRWYNsAumiAs6qoQ2TsYX4A9cgMI1emTa0EQjxh j72gJRBUuCycGnlRUez8Cu/oe3Ad8+BvsW0Du5xGpAOIu4/jm1Tx4sG4rIz+4ZKiurei 14Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=GHiV7sFt08C5sPb6EzlyDIUADIM2Z/zXqzgLd6C5Q0U=; b=rg2GBgbaWpq5JoawWlgICIdzEEcafZ0gxZ615ZaAs1B1/u5ZzlD+2YXwMm6opGLK9A RN40jssO4XOGnU4wLiy79kGsRj2NGe53nMxc3LTvNYXyDj/lOse3A7JS/hey82pzu+aR uJax4heDAHL1jW5Oo2r8t5ckOlbfGwmobfx8UqjYhABNq1cyzvkVPQodmXdasHTEPg5A VpMwXOWxV12j3sV1r6s5ifGsA7ZEHSUpKRG9sb+t64chgGEZEYoW2CTTH/QUfgEJffYN rCsoF3ahgGl1ofOGfrsFORwg+yNR/uGjisIjpVwumrzAr+vPC/2P+71POS1h18XYQXJr JIPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b14-20020a05640202ce00b00447978abf00si384078edx.226.2022.09.19.20.28.47; Mon, 19 Sep 2022 20:29:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229792AbiITDVc (ORCPT + 99 others); Mon, 19 Sep 2022 23:21:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229767AbiITDVY (ORCPT ); Mon, 19 Sep 2022 23:21:24 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BA76564CF; Mon, 19 Sep 2022 20:21:23 -0700 (PDT) Received: from canpemm500007.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MWmth1N0gzlW4N; Tue, 20 Sep 2022 11:17:16 +0800 (CST) Received: from localhost (10.174.179.215) by canpemm500007.china.huawei.com (7.192.104.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 20 Sep 2022 11:21:21 +0800 From: YueHaibing To: , , , , , , CC: , , , , YueHaibing Subject: [PATCH -next] crypto: aspeed - Fix check for platform_get_irq() errors Date: Tue, 20 Sep 2022 11:21:18 +0800 Message-ID: <20220920032118.6440-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.179.215] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500007.china.huawei.com (7.192.104.62) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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-crypto@vger.kernel.org The platform_get_irq() function returns negative on error and positive non-zero values on success. It never returns zero, but if it did then treat that as a success. Also remove redundant dev_err() print as platform_get_irq() already prints an error. Fixes: 108713a713c7 ("crypto: aspeed - Add HACE hash driver") Signed-off-by: YueHaibing --- drivers/crypto/aspeed/aspeed-hace.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/crypto/aspeed/aspeed-hace.c b/drivers/crypto/aspeed/aspeed-hace.c index 3f880aafb6a2..f7f1d33defb1 100644 --- a/drivers/crypto/aspeed/aspeed-hace.c +++ b/drivers/crypto/aspeed/aspeed-hace.c @@ -130,10 +130,8 @@ static int aspeed_hace_probe(struct platform_device *pdev) /* Get irq number and register it */ hace_dev->irq = platform_get_irq(pdev, 0); - if (!hace_dev->irq) { - dev_err(&pdev->dev, "Failed to get interrupt\n"); + if (hace_dev->irq < 0) return -ENXIO; - } rc = devm_request_irq(&pdev->dev, hace_dev->irq, aspeed_hace_irq, 0, dev_name(&pdev->dev), hace_dev); -- 2.17.1