From nobody Tue Dec 30 09:59:44 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50F49C072A2 for ; Fri, 17 Nov 2023 15:40:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346126AbjKQPkx (ORCPT ); Fri, 17 Nov 2023 10:40:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345949AbjKQPk3 (ORCPT ); Fri, 17 Nov 2023 10:40:29 -0500 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 769221720; Fri, 17 Nov 2023 07:40:25 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 3E2931BF216; Fri, 17 Nov 2023 15:40:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700235624; 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=ZYDQAQJQ/pdv7XNK0dqa7uzxPDAfbEfBIPQXanwGyRc=; b=hEcBsYJ1FPiTFf/NqsoO+kAGRT86Q7J3Vjzf1yx8JBgaC7n7+nvM+fWcorTwlkPgiUpTFo Iwr6tDDkUmCqnMiPkhlBT3V4/QbFyMB1Cg26wy0LRFfAer9GvflHok7h/HIDYkk9M7fF09 3pVrWxb9KAD/+67nKM36epO/c5To636o7sblha7i1tYNBdkIJgf71JgIB7CwxM0wdqsR03 8rNtKt+V21VnF5i43601ltWDnOCluHvLm4LegfJHoxojVF2ive4bzM5WaAGcqfIjkpI90j jyVKvN2xB/+5KYGZMQv8S+S/GSbq3F5/5433vDmH574NNALY6v9nBQgZP3rHMw== 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 Subject: [RFC PATCH net-next v2 07/10] net: ethtool: plca: Target the command to the requested PHY Date: Fri, 17 Nov 2023 17:23:18 +0100 Message-ID: <20231117162323.626979-8-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231117162323.626979-1-maxime.chevallier@bootlin.com> References: <20231117162323.626979-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: maxime.chevallier@bootlin.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" PLCA 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 --- net/ethtool/plca.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/net/ethtool/plca.c b/net/ethtool/plca.c index b1e2e3b5027f..2b3e419f4dc2 100644 --- a/net/ethtool/plca.c +++ b/net/ethtool/plca.c @@ -61,7 +61,7 @@ static int plca_get_cfg_prepare_data(const struct ethnl_r= eq_info *req_base, int ret; =20 // check that the PHY device is available and connected - if (!dev->phydev) { + if (!req_base->phydev) { ret =3D -EOPNOTSUPP; goto out; } @@ -80,7 +80,7 @@ static int plca_get_cfg_prepare_data(const struct ethnl_r= eq_info *req_base, memset(&data->plca_cfg, 0xff, sizeof_field(struct plca_reply_data, plca_cfg)); =20 - ret =3D ops->get_plca_cfg(dev->phydev, &data->plca_cfg); + ret =3D ops->get_plca_cfg(req_base->phydev, &data->plca_cfg); ethnl_ops_complete(dev); =20 out: @@ -141,7 +141,6 @@ const struct nla_policy ethnl_plca_set_cfg_policy[] =3D= { static int ethnl_set_plca(struct ethnl_req_info *req_info, struct genl_info *info) { - struct net_device *dev =3D req_info->dev; const struct ethtool_phy_ops *ops; struct nlattr **tb =3D info->attrs; struct phy_plca_cfg plca_cfg; @@ -149,7 +148,7 @@ ethnl_set_plca(struct ethnl_req_info *req_info, struct = genl_info *info) int ret; =20 // check that the PHY device is available and connected - if (!dev->phydev) + if (!req_info->phydev) return -EOPNOTSUPP; =20 ops =3D ethtool_phy_ops; @@ -168,7 +167,7 @@ ethnl_set_plca(struct ethnl_req_info *req_info, struct = genl_info *info) if (!mod) return 0; =20 - ret =3D ops->set_plca_cfg(dev->phydev, &plca_cfg, info->extack); + ret =3D ops->set_plca_cfg(req_info->phydev, &plca_cfg, info->extack); return ret < 0 ? ret : 1; } =20 @@ -204,7 +203,7 @@ static int plca_get_status_prepare_data(const struct et= hnl_req_info *req_base, int ret; =20 // check that the PHY device is available and connected - if (!dev->phydev) { + if (!req_base->phydev) { ret =3D -EOPNOTSUPP; goto out; } @@ -223,7 +222,7 @@ static int plca_get_status_prepare_data(const struct et= hnl_req_info *req_base, memset(&data->plca_st, 0xff, sizeof_field(struct plca_reply_data, plca_st)); =20 - ret =3D ops->get_plca_status(dev->phydev, &data->plca_st); + ret =3D ops->get_plca_status(req_base->phydev, &data->plca_st); ethnl_ops_complete(dev); out: return ret; --=20 2.41.0