From patchwork Wed Jun 16 02:39:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Li X-Patchwork-Id: 12323771 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E87DBC48BDF for ; Wed, 16 Jun 2021 02:41:03 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8E8E561055 for ; Wed, 16 Jun 2021 02:41:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E8E561055 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id: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=GuT09zVBq12pZEvjooalIh0MGkTpy+FvB2jMReLTTOM=; b=irwzQE5hnZxRnA +XRzL5q9T9GbigNJA6TaHW78KsiaftJOVmEV0g/iwKbleXJl+IsnR397wrB7Ky9+41o2yiEyYcjZv hZWmbMv+SlbXB1ACf/pNSSzFXMfOnabaycHp8o0OL3GOtGOOLyYGfG61U0Y2z0PpoFzfLMnkUEo7Z Max1C4zPX90ipoJRT6jnLYfCYhvipklAbr4Quy8QNlJ33F2zw0x2wTAV1jbzcIaY2sNC5nVSV8BSd votlES7vIrspXZ8W9PBkh6yF2l7T9eUyXj6RElN5hSmDdZ9ATBqOR35zZy5qcPV9RUwxVBhtkoBbl IwuTvMa5mH4PL1wNxaFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltLSd-004UkL-Vm; Wed, 16 Jun 2021 02:39:24 +0000 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltLSa-004UjD-JH for linux-arm-kernel@lists.infradead.org; Wed, 16 Jun 2021 02:39:22 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R121e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04395; MF=yang.lee@linux.alibaba.com; NM=1; PH=DS; RN=11; SR=0; TI=SMTPD_---0UcZRreS_1623811153; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0UcZRreS_1623811153) by smtp.aliyun-inc.com(127.0.0.1); Wed, 16 Jun 2021 10:39:15 +0800 From: Yang Li To: peppe.cavallaro@st.com Cc: alexandre.torgue@foss.st.com, joabreu@synopsys.com, davem@davemloft.net, kuba@kernel.org, mcoquelin.stm32@gmail.com, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Yang Li Subject: [PATCH -next] net: stmmac: Fix an error code in dwmac-ingenic.c Date: Wed, 16 Jun 2021 10:39:08 +0800 Message-Id: <1623811148-11064-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210615_193920_850024_98DC29D1 X-CRM114-Status: UNSURE ( 8.24 ) X-CRM114-Notice: Please train this message. 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When IS_ERR(mac->regmap) returns true, the value of ret is 0. So, we set ret to -ENODEV to indicate this error. Clean up smatch warning: drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c:266 ingenic_mac_probe() warn: missing error code 'ret' Reported-by: Abaci Robot Signed-off-by: Yang Li --- drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c index 60984c1..f3950e0 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c @@ -263,6 +263,7 @@ static int ingenic_mac_probe(struct platform_device *pdev) mac->regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "mode-reg"); if (IS_ERR(mac->regmap)) { dev_err(&pdev->dev, "%s: Failed to get syscon regmap\n", __func__); + ret = -ENODEV; goto err_remove_config_dt; }