Skip to content

Commit fcc4b10

Browse files
minimaxwelldavem330
authored andcommitted
net: ethtool: cable-test: Target the command to the requested PHY
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 <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 345237d commit fcc4b10

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

net/ethtool/cabletest.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ int ethnl_act_cable_test(struct sk_buff *skb, struct genl_info *info)
6969
return ret;
7070

7171
dev = req_info.dev;
72-
if (!dev->phydev) {
72+
if (!req_info.phydev) {
7373
ret = -EOPNOTSUPP;
7474
goto out_dev_put;
7575
}
@@ -85,12 +85,12 @@ int ethnl_act_cable_test(struct sk_buff *skb, struct genl_info *info)
8585
if (ret < 0)
8686
goto out_rtnl;
8787

88-
ret = ops->start_cable_test(dev->phydev, info->extack);
88+
ret = ops->start_cable_test(req_info.phydev, info->extack);
8989

9090
ethnl_ops_complete(dev);
9191

9292
if (!ret)
93-
ethnl_cable_test_started(dev->phydev,
93+
ethnl_cable_test_started(req_info.phydev,
9494
ETHTOOL_MSG_CABLE_TEST_NTF);
9595

9696
out_rtnl:
@@ -321,7 +321,7 @@ int ethnl_act_cable_test_tdr(struct sk_buff *skb, struct genl_info *info)
321321
return ret;
322322

323323
dev = req_info.dev;
324-
if (!dev->phydev) {
324+
if (!req_info.phydev) {
325325
ret = -EOPNOTSUPP;
326326
goto out_dev_put;
327327
}
@@ -342,12 +342,12 @@ int ethnl_act_cable_test_tdr(struct sk_buff *skb, struct genl_info *info)
342342
if (ret < 0)
343343
goto out_rtnl;
344344

345-
ret = ops->start_cable_test_tdr(dev->phydev, info->extack, &cfg);
345+
ret = ops->start_cable_test_tdr(req_info.phydev, info->extack, &cfg);
346346

347347
ethnl_ops_complete(dev);
348348

349349
if (!ret)
350-
ethnl_cable_test_started(dev->phydev,
350+
ethnl_cable_test_started(req_info.phydev,
351351
ETHTOOL_MSG_CABLE_TEST_TDR_NTF);
352352

353353
out_rtnl:

0 commit comments

Comments
 (0)