Commit 9b56d9a5 authored by Guangbin Huang's avatar Guangbin Huang Committed by David S. Miller
Browse files

net: hns3: delete redundant PCI revision judgement



Fibre device of PCI revision 0x20 don't support autoneg, and the ops
get_autoneg() return AUTONEG_DISABLE so function hns3_nway_reset()
will return earlier than judging PCI revision.

Function hclge_handle_rocee_ras_error() don't need to judge PCI
revision again because its caller hclge_handle_hw_ras_error() has
judged once.

Signed-off-by: default avatarGuangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 295ba232
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -1076,9 +1076,6 @@ static int hns3_nway_reset(struct net_device *netdev)
	if (phy)
		return genphy_restart_aneg(phy);

	if (handle->pdev->revision == 0x20)
		return -EOPNOTSUPP;

	return ops->restart_autoneg(handle);
}

+1 −2
Original line number Diff line number Diff line
@@ -1577,8 +1577,7 @@ static void hclge_handle_rocee_ras_error(struct hnae3_ae_dev *ae_dev)
	struct hclge_dev *hdev = ae_dev->priv;
	enum hnae3_reset_type reset_type;

	if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state) ||
	    hdev->pdev->revision < 0x21)
	if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state))
		return;

	reset_type = hclge_log_and_clear_rocee_ras_error(hdev);