net: hns3: fix for getting auto-negotiation state in hclge_get_autoneg
authorFuyun Liang <liangfuyun1@huawei.com>
Fri, 22 Dec 2017 04:21:50 +0000 (12:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Apr 2018 10:32:12 +0000 (12:32 +0200)
commitfcb762cb4b5ccee501f10d1d798b26b16cc26a28
tree5c26425c53ff100c43dde7e7bbb6843e80e56dda
parentf7b0ea2245a0c7e6b255b0fa6f0a83a04a821da5
net: hns3: fix for getting auto-negotiation state in hclge_get_autoneg

[ Upstream commit 27b5bf49f0924fd62d2b1ef8467b40773973da34 ]

When phy exists, we use the value of phydev.autoneg to represent the
auto-negotiation state of hardware. Otherwise, we use the value of
mac.autoneg to represent it.

This patch fixes for getting a error value of auto-negotiation state in
hclge_get_autoneg().

Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c