net: hns3: fix for phy_addr error in hclge_mac_mdio_config
authorHuazhong Tan <tanhuazhong@huawei.com>
Tue, 1 May 2018 18:56:01 +0000 (19:56 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 May 2018 19:08:37 +0000 (15:08 -0400)
commitc5ef83cbb1e9fa17a3b78fb2deb25ae8beebbf48
tree9bacfda20143e4fa5b2fbe45373d631ddb429494
parentffd5656e182b94148998b48f748112450c9ff2b0
net: hns3: fix for phy_addr error in hclge_mac_mdio_config

When phy exists, phy_addr must less than PHY_MAX_ADDR.
If not, hclge_mac_mdio_config should return error.
And for fiber(phy_addr=0xff), it does not need hclge_mac_mdio_config.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c