Skip to content

Commit 017bf1c

Browse files
ecsvjonasjelonek
authored andcommitted
kernel: rtl8261n: drop unreachable PHY register patch
The PHY register patch in question is gated by `CONFIG_MACH_REALTEK_RTL`, has no documented/expected behavior, and is in practice unreachable: `phy_patch()` is only called from `rtkphy_config_init()`, which is exits (too) early for `CONFIG_MACH_REALTEK_RTL` builds. Remove it as a cleanup step before enabling standard USXGMII configuration for these PHYs. Fixes: b77fa45 ("kernel: fix rtl8261n driver for realtek") Co-authored-by: Jonas Jelonek <jelonek.jonas@gmail.com> Signed-off-by: Sven Eckelmann <sven@narfation.org> Link: openwrt/openwrt#23076 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
1 parent 8ef7b4e commit 017bf1c

1 file changed

Lines changed: 0 additions & 15 deletions

File tree

  • target/linux/generic/files/drivers/net/phy/rtl8261n

target/linux/generic/files/drivers/net/phy/rtl8261n/phy_patch.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,6 @@ static int32 _phy_patch_process(uint32 unit, rtk_port_t port, uint8 portOffset,
9898
return (chk_ret == RT_ERR_CHECK_FAILED) ? chk_ret : RT_ERR_OK;
9999
}
100100

101-
rtk_hwpatch_t rtl826XB_patch_rtk_conf[] = {
102-
{RTK_PATCH_OP_PSDS0 , 0xff , 0x07 , 0x10 , 15, 0, 0x80aa, RTK_PATCH_CMP_WC , 0, 0, 0, 0},
103-
{RTK_PATCH_OP_PSDS0 , 0xff , 0x06 , 0x12 , 15, 0, 0x5078, RTK_PATCH_CMP_WC , 0, 0, 0, 0},
104-
};
105-
106101
/* Function Name:
107102
* phy_patch
108103
* Description:
@@ -175,16 +170,6 @@ int32 phy_patch(uint32 unit, rtk_port_t port, uint8 portOffset, uint8 patch_mode
175170
break;
176171
}
177172
}
178-
#ifdef CONFIG_MACH_REALTEK_RTL
179-
ret = _phy_patch_process(unit, port, portOffset, rtl826XB_patch_rtk_conf, sizeof(rtl826XB_patch_rtk_conf), patch_mode);
180-
if (ret == RT_ERR_CHECK_FAILED)
181-
chk_ret = ret;
182-
else if (ret != RT_ERR_OK)
183-
{
184-
RT_LOG(LOG_MAJOR_ERR, (MOD_HAL | MOD_PHY), "U%u P%u patch_mode:%u id:%u patch-%u failed. ret:0x%X\n", unit, port, patch_mode, i, patch_type, ret);
185-
return ret;
186-
}
187-
#endif
188173

189174
return (chk_ret == RT_ERR_CHECK_FAILED) ? chk_ret : RT_ERR_OK;
190175
}

0 commit comments

Comments
 (0)