
From: Yanteng Si <siyanteng@loongson.cn> maillist inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I9RPAR Reference: https://lore.kernel.org/all/cover.1714046812.git.siyanteng@loongson.cn -------------------------------- We've already introduced loongson_gnet_data(), so the STMMAC_FLAG_DISABLE_FORCE_1000 should be take away from loongson_dwmac_probe(). Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn> Signed-off-by: Yinggang Gu <guyinggang@loongson.cn> Signed-off-by: Yanteng Si <siyanteng@loongson.cn> Signed-off-by: Ming Wang <wangming01@loongson.cn> --- .../net/ethernet/stmicro/stmmac/dwmac-loongson.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c index f90e7d6b1ac3..35600a38b074 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c @@ -286,6 +286,12 @@ static int loongson_gnet_data(struct pci_dev *pdev, plat->mdio_bus_data->phy_mask = ~(u32)BIT(2); plat->fix_mac_speed = loongson_gnet_fix_speed; + /* GNET devices with dev revision 0x00 do not support manually + * setting the speed to 1000. + */ + if (pdev->revision == 0x00) + plat->flags |= STMMAC_FLAG_DISABLE_FORCE_1000; + return 0; } @@ -539,13 +545,6 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id break; } - /* GNET devices with dev revision 0x00 do not support manually - * setting the speed to 1000. - */ - if (pdev->device == PCI_DEVICE_ID_LOONGSON_GNET && - pdev->revision == 0x00) - plat->flags |= STMMAC_FLAG_DISABLE_FORCE_1000; - ret = stmmac_dvr_probe(&pdev->dev, plat, &res); if (ret) goto err_disable_device; -- 2.33.0