Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4367662imw; Tue, 12 Jul 2022 06:51:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tVyQIwXYH6czc3SkMrPZSuTlgdhikyYD50W0L4d0SmfzUNoxJ01VeBOcOs5NQ4CwJ9vPmP X-Received: by 2002:a17:906:cc12:b0:72b:67bb:80c3 with SMTP id ml18-20020a170906cc1200b0072b67bb80c3mr7480177ejb.668.1657633893687; Tue, 12 Jul 2022 06:51:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657633893; cv=none; d=google.com; s=arc-20160816; b=QHBjVTc64AEzMn+LcSPKNx2q+iBlH3/o4ZIZIxrE9kd93H4eksg9Af8aiIDEU+zGIq I8cbN6u2kPPKwr+we/tEBJRYVMUcb9xleHvM8CXBT0pgEuSsc/koGBYQ5GOqB0kWfoPD YCdrC4AmSM/7u5uaBm2qXaRszzm8qtwkGootYbi4Hh8bODIpkrucAVVmEw01FxqcCGzh WwTRqaPERaPcmWng3PDbwVBTgVSY2QfeoBJIP0/bxe23h6siPekGP8tO/rqInId/zmsP Nqy4564dum6B2ppLeagbSXT4NIOFd/7rtRg6ZCG3C6Ny0KTeyXPj7QPD6mfhKJFXx0kI sI9Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YKhzt3cpITEJyGyy9hsxcRxMJ7yw3/fJk2ysgW6U4JY=; b=t1k5GdObjQy7JRZ4PXLrzp3wxG+F7C7273f007M5jua6qXZ4y8T+DtP/kG7wTw0ryM 2Yus38xOH7Ytx/ex2TmI4DVL6uvk/5eb/9KYpqhRor1M5MDQ2HfuogPbQSlPcMX2Lf33 VgB8qM5hNV3MGMN6hy9YzLfd0bIUvRTn/ySfyb1LASFhHxHxYYg2kyw/PbuifwmVUHsn SI3zsBumWJyMUobYYj3pE/1Yn2s29VPAbvcJz4LrHxcl0fl2MJNgDjSiOvSzSNe6sT30 G0y2Xl+aK+TofRzR5CgQMICGW93KM/qaUcbRIhK0nWwc8uxBkB+uuhxXTsaJtpNsAHk6 +IAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=ii+xTKVa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a21-20020a170906191500b006f508f07fa1si12483708eje.458.2022.07.12.06.51.08; Tue, 12 Jul 2022 06:51:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=ii+xTKVa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233008AbiGLNQY (ORCPT + 99 others); Tue, 12 Jul 2022 09:16:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232343AbiGLNQJ (ORCPT ); Tue, 12 Jul 2022 09:16:09 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D333C7AB1B; Tue, 12 Jul 2022 06:16:03 -0700 (PDT) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 4C10A22248; Tue, 12 Jul 2022 15:16:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1657631761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YKhzt3cpITEJyGyy9hsxcRxMJ7yw3/fJk2ysgW6U4JY=; b=ii+xTKVa3ZeGjM4nMcroApaA2P6iByzeL5OlSdUmoC5nO2Ip5U7BOZhUgJa71EER8ToyVo w6w0AguvD1gDza0OVUIttcLFhc5R5pPAaWqfYiB4SEfDkzk99FrXWZHiLTUKfRWgpTvzJ9 Hh0akFYIBT8WuxSPnYdgLMogMhTmAEU= From: Michael Walle To: Xu Liang , Andrew Lunn , Heiner Kallweit , Russell King , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Walle Subject: [PATCH net-next 1/4] net: phy: mxl-gpy: fix version reporting Date: Tue, 12 Jul 2022 15:15:51 +0200 Message-Id: <20220712131554.2737792-2-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220712131554.2737792-1-michael@walle.cc> References: <20220712131554.2737792-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org The commit 09ce6b20103b ("net: phy: mxl-gpy: add temperature sensor") will overwrite the return value and the reported version will be wrong. Fix it. Fixes: 09ce6b20103b ("net: phy: mxl-gpy: add temperature sensor") Signed-off-by: Michael Walle --- drivers/net/phy/mxl-gpy.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/phy/mxl-gpy.c b/drivers/net/phy/mxl-gpy.c index 5b99acf44337..9728ef93fc0b 100644 --- a/drivers/net/phy/mxl-gpy.c +++ b/drivers/net/phy/mxl-gpy.c @@ -198,6 +198,7 @@ static int gpy_config_init(struct phy_device *phydev) static int gpy_probe(struct phy_device *phydev) { + int fw_version; int ret; if (!phydev->is_c45) { @@ -207,16 +208,16 @@ static int gpy_probe(struct phy_device *phydev) } /* Show GPY PHY FW version in dmesg */ - ret = phy_read(phydev, PHY_FWV); - if (ret < 0) - return ret; + fw_version = phy_read(phydev, PHY_FWV); + if (fw_version < 0) + return fw_version; ret = gpy_hwmon_register(phydev); if (ret) return ret; - phydev_info(phydev, "Firmware Version: 0x%04X (%s)\n", ret, - (ret & PHY_FWV_REL_MASK) ? "release" : "test"); + phydev_info(phydev, "Firmware Version: 0x%04X (%s)\n", fw_version, + (fw_version & PHY_FWV_REL_MASK) ? "release" : "test"); return 0; } -- 2.30.2