mediatek: mt753x: fix P5 P6 phy_mode

This commit is contained in:
hanwckf 2022-10-19 12:33:52 +08:00
parent 2d60ba677b
commit ac468843b4
2 changed files with 6 additions and 6 deletions

View File

View File

@ -249,8 +249,8 @@ static void mt753x_load_port_cfg(struct gsw_mt753x *gsw)
struct device_node *port_np;
struct device_node *fixed_link_node;
struct mt753x_port_cfg *port_cfg;
phy_interface_t phy_mode;
u32 port;
int ret;
for_each_child_of_node(gsw->dev->of_node, port_np) {
if (!of_device_is_compatible(port_np, "mediatek,mt753x-port"))
@ -281,11 +281,12 @@ static void mt753x_load_port_cfg(struct gsw_mt753x *gsw)
port_cfg->np = port_np;
ret = of_get_phy_mode(port_cfg->np);
if (ret < 0) {
phy_mode = of_get_phy_mode(port_cfg->np);
if ((int)phy_mode < 0) {
dev_info(gsw->dev, "incorrect phy-mode %d\n", port);
continue;
}
port_cfg->phy_mode = phy_mode;
fixed_link_node = of_get_child_by_name(port_np, "fixed-link");
if (fixed_link_node) {
@ -578,7 +579,6 @@ static void mt753x_connect_internal_phys(struct gsw_mt753x *gsw,
struct device_node *phy_np;
struct mt753x_phy *phy;
phy_interface_t iface;
int ret;
u32 phyad;
if (!mii_np)
@ -591,8 +591,8 @@ static void mt753x_connect_internal_phys(struct gsw_mt753x *gsw,
if (phyad >= MT753X_NUM_PHYS)
continue;
ret = of_get_phy_mode(phy_np);
if (ret < 0) {
iface = of_get_phy_mode(phy_np);
if ((int)iface < 0) {
dev_info(gsw->dev, "incorrect phy-mode %d for PHY %d\n",
iface, phyad);
continue;