Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp324769rdb; Thu, 21 Dec 2023 10:07:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IFue+sZY/u1f9g+w+C2CRXFLCpcsK4ZcfpdSwFb1F/+vSdIVxCfHmwKLjelePGDshqbU7Ue X-Received: by 2002:a05:6a20:914f:b0:18c:3199:7174 with SMTP id x15-20020a056a20914f00b0018c31997174mr1417552pzc.19.1703182030560; Thu, 21 Dec 2023 10:07:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703182030; cv=none; d=google.com; s=arc-20160816; b=L0jHqGZxjZKIAQNfTPn2iF2q+gOm8HC1OI+EoHjbV1zXpHaxZg1mEzIim/tWnXQPeO vTId9632axJCPl1OnbFIj/B7Hs1JykWHzauxJfwaUG0LmYftdsH76nsOJdPez3nFtx7i X4z0HLg3Uf5nCND1z6InhAh83Jb9vfC2FxFWN8BUGUDfs6KKUIaSUHll2UFy0HWrDteb NKPfGufyisX3DuCoq7uOpHuQa2WYPNyP8rlZd3QjekMkZEhXeIIEuRA+7threagI6iym 4AwY4z0l2suSuF3wWRjgxCX4TH+CedIRH0sNkr/XKDy0G8nWqDxrhQt9in8yQ+ZdHyPj CqfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=h/OcM575L8jfFrXX7VS5ua1XDSMjSEzffW/tbXnntiI=; fh=d3Krop4IPE3x6nBOvh3GY5QHg6bS91zVnQiH59I3hyM=; b=V3W8h0LyuaHNMGJFpc5CL9HkwRarqGQwPxwk2oAa9LkT6yT+hGut79s0Fr//vShp3u IRzHgMBtnnA4yltUy2fnaJv5tjE++w7p9Mdvhhe/tD6WBXiXzS6+66hKxmGb8QzcgEsq hVgQnwVsqh1hjW/EkdjGroAK4rJtg1S16VhSb+zJcTfNaGuqHawIS/DHpyxOlVjskZsJ qCS3fEfV+j+edo2VDjpd5MOM4VLmHzZ+bdvxJHYKoK//GAYRbPhrTE8FybVZ7D53aN6c bl71Ku7XEDzi/51axmCX9oj3lXB+upPT9a7LZv6Ksc4a6BjLy/q9uqs0f3jcE5pOFOuq Q4Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=VyH2yd6j; spf=pass (google.com: domain of linux-kernel+bounces-8896-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8896-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id g14-20020a056a0023ce00b006d96d3a4a75si1803569pfc.39.2023.12.21.10.07.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 10:07:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8896-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=VyH2yd6j; spf=pass (google.com: domain of linux-kernel+bounces-8896-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8896-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D9581B23C2E for ; Thu, 21 Dec 2023 18:04:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C503B78E7F; Thu, 21 Dec 2023 18:01:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="VyH2yd6j" X-Original-To: linux-kernel@vger.kernel.org Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0951C77B2D; Thu, 21 Dec 2023 18:01:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 031711C0014; Thu, 21 Dec 2023 18:01:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1703181666; 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=h/OcM575L8jfFrXX7VS5ua1XDSMjSEzffW/tbXnntiI=; b=VyH2yd6jgkQerMi4KTWgfHqLztMfSWsKsUpetFQzgZGycFFvcdutjL/CCXb5HJOv8E3LIk wjZ7aw82tUPnOTtd/d44oloODjD1it13YaHZ/dWfuYYnLAiYZ0xPWu0fpJBEyp8SmAIzd1 3Qo5eD00lmTLuJ7sHY0nI8erKmiSdGhYLd3iny+VD11Vq6+zYSUXOr8/EjRJCBaFkaAIkA jHZBh6bG6cIMm+kytQvI88DU2xR2tSr2xcnbiZomH4DJ9GAgtlGmwkHQ2x+Ct6P6S2HoKL +tIUlvy+JXQW7yUrls9cB7yoUuqPg8in5y6vtdT1VUoxZsMOrtvGy8sAkfipqA== From: Maxime Chevallier To: davem@davemloft.net Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , =?UTF-8?q?K=C3=B6ry=20Maincent?= , Jesse Brandeburg , Jonathan Corbet , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Piergiorgio Beruto , Oleksij Rempel , =?UTF-8?q?Nicol=C3=B2=20Veronese?= , Simon Horman Subject: [PATCH net-next v5 11/13] net: ethtool: cable-test: Target the command to the requested PHY Date: Thu, 21 Dec 2023 19:00:44 +0100 Message-ID: <20231221180047.1924733-12-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221180047.1924733-1-maxime.chevallier@bootlin.com> References: <20231221180047.1924733-1-maxime.chevallier@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: maxime.chevallier@bootlin.com Cable testing is a PHY-specific command. Instead of targeting the command towards dev->phydev, use the request to pick the targeted PHY. Signed-off-by: Maxime Chevallier Reviewed-by: Andrew Lunn --- V5: Added Andrew's R-b V4: No changes V3: No changes V2: New patch net/ethtool/cabletest.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/ethtool/cabletest.c b/net/ethtool/cabletest.c index 06a151165c31..6b00d0800f23 100644 --- a/net/ethtool/cabletest.c +++ b/net/ethtool/cabletest.c @@ -69,7 +69,7 @@ int ethnl_act_cable_test(struct sk_buff *skb, struct genl_info *info) return ret; dev = req_info.dev; - if (!dev->phydev) { + if (!req_info.phydev) { ret = -EOPNOTSUPP; goto out_dev_put; } @@ -85,12 +85,12 @@ int ethnl_act_cable_test(struct sk_buff *skb, struct genl_info *info) if (ret < 0) goto out_rtnl; - ret = ops->start_cable_test(dev->phydev, info->extack); + ret = ops->start_cable_test(req_info.phydev, info->extack); ethnl_ops_complete(dev); if (!ret) - ethnl_cable_test_started(dev->phydev, + ethnl_cable_test_started(req_info.phydev, ETHTOOL_MSG_CABLE_TEST_NTF); out_rtnl: @@ -321,7 +321,7 @@ int ethnl_act_cable_test_tdr(struct sk_buff *skb, struct genl_info *info) return ret; dev = req_info.dev; - if (!dev->phydev) { + if (!req_info.phydev) { ret = -EOPNOTSUPP; goto out_dev_put; } @@ -342,12 +342,12 @@ int ethnl_act_cable_test_tdr(struct sk_buff *skb, struct genl_info *info) if (ret < 0) goto out_rtnl; - ret = ops->start_cable_test_tdr(dev->phydev, info->extack, &cfg); + ret = ops->start_cable_test_tdr(req_info.phydev, info->extack, &cfg); ethnl_ops_complete(dev); if (!ret) - ethnl_cable_test_started(dev->phydev, + ethnl_cable_test_started(req_info.phydev, ETHTOOL_MSG_CABLE_TEST_TDR_NTF); out_rtnl: -- 2.43.0