Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp440268ybj; Wed, 6 May 2020 22:41:36 -0700 (PDT) X-Google-Smtp-Source: APiQypICTC7mPSWnGL+bf+vN5aEtg4g8UP+L0BuUGto+XPD0zoHIMUjLMzyKACrp6mWAGCnUOhfo X-Received: by 2002:a17:906:9518:: with SMTP id u24mr10628900ejx.320.1588830096616; Wed, 06 May 2020 22:41:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588830096; cv=none; d=google.com; s=arc-20160816; b=qIm/e8a0fagQ9EgzjBLTW1g0AYB5vQ5wIRHyemgLYFZxgjojS7yXmI8w3tt6pZ/6Nq TqbL+acslDQrSL9fkiks4VRLAL6m21Iz4QBmDZRRn/S1gI0vzOS04gIbGMXiJzUKHjCr NEplMTaUakXJziW+WRdD1CmcN/WpTrn+mvgD9DiCoQCYan1KQPo8r/yoSB26zQl8YAmm fk+OmLDcPUXGMGlETgPCyf6CXn1k5Agsgcbwdgi7L18hXgHN22ZJM5Vn8YpDQS+hkmQg EsvtDAdJWvo3UfxMePpDDCKMZHc4rZN/l5L9VNRlTwvxsa2Qj/1PcvZSg/aeyc1Cqf1u NDyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=N6IIW1wjDzdbLXH8QiI0VIuukkR8lnw9h7oKsQsOCBk=; b=t9ay+Ncd8KB+Ba2i2uZnPyfGRl6uoHY66vrRRyj3s28pg+na7NVgAepwo+gLnFWBXh FTd1mozOr+pFvb3qfT8iOm6QtKb4H+CKQYQgd7e/k7uP6bX+Ja9sr0DxQ60glfMVSjJL QHrTMYp70FJmBqcSmnsN4YU7bRYSHdoYuHiNZRorZ7CLpH4yzakFEi7HrfhHQsg8MQW6 U+tKopRmBll3n7/Qh3/uxG5z3Lbujl8lPj20X2iFFGguhUtLLgan5Aj0yUYo4fyPC06D 8oG9l1cbde9M1iQdtokBt3WOzX47YWuZcl0gU1la40TNksRoZokuiz2Dks3IRfnnqmBk 6sPg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cn25si2267672edb.589.2020.05.06.22.41.13; Wed, 06 May 2020 22:41:36 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726579AbgEGFhV (ORCPT + 99 others); Thu, 7 May 2020 01:37:21 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:3880 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725783AbgEGFhV (ORCPT ); Thu, 7 May 2020 01:37:21 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 226588F91EE7F719A0CA; Thu, 7 May 2020 13:37:14 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.487.0; Thu, 7 May 2020 13:37:05 +0800 From: Wei Yongjun To: Kishon Vijay Abraham I , Vinod Koul , Philipp Zabel , Jyri Sarha , "Roger Quadros" , Sekhar Nori , Wei Yongjun CC: , , "Hulk Robot" Subject: [PATCH -next] phy: ti: j721e-wiz: Fix some error return code in wiz_probe() Date: Thu, 7 May 2020 05:41:09 +0000 Message-ID: <20200507054109.110849-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix to return negative error code from some error handling cases instead of 0, as done elsewhere in this function. Fixes: 091876cc355d ("phy: ti: j721e-wiz: Add support for WIZ module present in TI J721E SoC") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun --- drivers/phy/ti/phy-j721e-wiz.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/phy/ti/phy-j721e-wiz.c b/drivers/phy/ti/phy-j721e-wiz.c index 1d12d1b1b63a..30ea5b207285 100644 --- a/drivers/phy/ti/phy-j721e-wiz.c +++ b/drivers/phy/ti/phy-j721e-wiz.c @@ -841,8 +841,10 @@ static int wiz_probe(struct platform_device *pdev) } base = devm_ioremap(dev, res.start, resource_size(&res)); - if (!base) + if (!base) { + ret = -ENOMEM; goto err_addr_to_resource; + } regmap = devm_regmap_init_mmio(dev, base, &wiz_regmap_config); if (IS_ERR(regmap)) { @@ -859,6 +861,7 @@ static int wiz_probe(struct platform_device *pdev) if (num_lanes > WIZ_MAX_LANES) { dev_err(dev, "Cannot support %d lanes\n", num_lanes); + ret = -ENODEV; goto err_addr_to_resource; } @@ -948,6 +951,7 @@ static int wiz_probe(struct platform_device *pdev) serdes_pdev = of_platform_device_create(child_node, NULL, dev); if (!serdes_pdev) { dev_WARN(dev, "Unable to create SERDES platform device\n"); + ret = -ENOMEM; goto err_pdev_create; } wiz->serdes_pdev = serdes_pdev;