mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-27 01:11:14 +00:00
7d256aff7b
The previous iteration of MediaTek's PHY patches caused various weird bugs. Drop culprit patch 733-10-net-phy-mediatek-Extend-1G-TX-RX-link-pulse-time.patch and use the most recent iteration of the patchset which has been posted to the netdev mailing list. Link: https://patchwork.kernel.org/project/netdevbpf/list/?series=895513&state=* Fixes: #16448 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
71 lines
2.3 KiB
Diff
71 lines
2.3 KiB
Diff
From 2b118202583eb05a1799d435d2dce974dc3f5b16 Mon Sep 17 00:00:00 2001
|
|
From: "SkyLake.Huang" <skylake.huang@mediatek.com>
|
|
Date: Fri, 4 Oct 2024 18:24:08 +0800
|
|
Subject: [PATCH 4/9] net: phy: mediatek: Improve readability of
|
|
mtk-phy-lib.c's mtk_phy_led_hw_ctrl_set()
|
|
|
|
This patch removes parens around TRIGGER_NETDEV_RX/TRIGGER_NETDEV_TX in
|
|
mtk_phy_led_hw_ctrl_set(), which improves readability.
|
|
|
|
Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
|
|
---
|
|
drivers/net/phy/mediatek/mtk-phy-lib.c | 44 ++++++++++++++------------
|
|
1 file changed, 24 insertions(+), 20 deletions(-)
|
|
|
|
--- a/drivers/net/phy/mediatek/mtk-phy-lib.c
|
|
+++ b/drivers/net/phy/mediatek/mtk-phy-lib.c
|
|
@@ -127,29 +127,33 @@ int mtk_phy_led_hw_ctrl_set(struct phy_d
|
|
on |= MTK_PHY_LED_ON_LINK2500;
|
|
|
|
if (rules & BIT(TRIGGER_NETDEV_RX)) {
|
|
- blink |= (on & on_set) ?
|
|
- (((on & MTK_PHY_LED_ON_LINK10) ?
|
|
- MTK_PHY_LED_BLINK_10RX : 0) |
|
|
- ((on & MTK_PHY_LED_ON_LINK100) ?
|
|
- MTK_PHY_LED_BLINK_100RX : 0) |
|
|
- ((on & MTK_PHY_LED_ON_LINK1000) ?
|
|
- MTK_PHY_LED_BLINK_1000RX : 0) |
|
|
- ((on & MTK_PHY_LED_ON_LINK2500) ?
|
|
- MTK_PHY_LED_BLINK_2500RX : 0)) :
|
|
- rx_blink_set;
|
|
+ if (on & on_set) {
|
|
+ if (on & MTK_PHY_LED_ON_LINK10)
|
|
+ blink |= MTK_PHY_LED_BLINK_10RX;
|
|
+ if (on & MTK_PHY_LED_ON_LINK100)
|
|
+ blink |= MTK_PHY_LED_BLINK_100RX;
|
|
+ if (on & MTK_PHY_LED_ON_LINK1000)
|
|
+ blink |= MTK_PHY_LED_BLINK_1000RX;
|
|
+ if (on & MTK_PHY_LED_ON_LINK2500)
|
|
+ blink |= MTK_PHY_LED_BLINK_2500RX;
|
|
+ } else {
|
|
+ blink |= rx_blink_set;
|
|
+ }
|
|
}
|
|
|
|
if (rules & BIT(TRIGGER_NETDEV_TX)) {
|
|
- blink |= (on & on_set) ?
|
|
- (((on & MTK_PHY_LED_ON_LINK10) ?
|
|
- MTK_PHY_LED_BLINK_10TX : 0) |
|
|
- ((on & MTK_PHY_LED_ON_LINK100) ?
|
|
- MTK_PHY_LED_BLINK_100TX : 0) |
|
|
- ((on & MTK_PHY_LED_ON_LINK1000) ?
|
|
- MTK_PHY_LED_BLINK_1000TX : 0) |
|
|
- ((on & MTK_PHY_LED_ON_LINK2500) ?
|
|
- MTK_PHY_LED_BLINK_2500TX : 0)) :
|
|
- tx_blink_set;
|
|
+ if (on & on_set) {
|
|
+ if (on & MTK_PHY_LED_ON_LINK10)
|
|
+ blink |= MTK_PHY_LED_BLINK_10TX;
|
|
+ if (on & MTK_PHY_LED_ON_LINK100)
|
|
+ blink |= MTK_PHY_LED_BLINK_100TX;
|
|
+ if (on & MTK_PHY_LED_ON_LINK1000)
|
|
+ blink |= MTK_PHY_LED_BLINK_1000TX;
|
|
+ if (on & MTK_PHY_LED_ON_LINK2500)
|
|
+ blink |= MTK_PHY_LED_BLINK_2500TX;
|
|
+ } else {
|
|
+ blink |= tx_blink_set;
|
|
+ }
|
|
}
|
|
|
|
if (blink || on)
|