Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1931dc20 authored by Fuyun Liang's avatar Fuyun Liang Committed by David S. Miller
Browse files

net: hns3: fix for not returning problem in get_link_ksettings when phy exists



When phy exists, phy_ethtool_ksettings_get function is enough to get the
link ksettings. If the phy exists, get_link_ksettings function can return
directly after phy_ethtool_ksettings_get is called.

Signed-off-by: default avatarFuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4a152de9
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -569,9 +569,13 @@ static int hns3_get_link_ksettings(struct net_device *netdev,
		return -EOPNOTSUPP;

	/* 1.auto_neg & speed & duplex from cmd */
	if (netdev->phydev)
	if (netdev->phydev) {
		phy_ethtool_ksettings_get(netdev->phydev, cmd);
	else if (h->ae_algo->ops->get_ksettings_an_result)

		return 0;
	}

	if (h->ae_algo->ops->get_ksettings_an_result)
		h->ae_algo->ops->get_ksettings_an_result(h,
							 &cmd->base.autoneg,
							 &cmd->base.speed,