aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/pending-5.15/726-net-phy-realtek-use-phy_read_paged-instead-of-open-c.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/generic/pending-5.15/726-net-phy-realtek-use-phy_read_paged-instead-of-open-c.patch')
-rw-r--r--target/linux/generic/pending-5.15/726-net-phy-realtek-use-phy_read_paged-instead-of-open-c.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/target/linux/generic/pending-5.15/726-net-phy-realtek-use-phy_read_paged-instead-of-open-c.patch b/target/linux/generic/pending-5.15/726-net-phy-realtek-use-phy_read_paged-instead-of-open-c.patch
new file mode 100644
index 0000000000..250436ff39
--- /dev/null
+++ b/target/linux/generic/pending-5.15/726-net-phy-realtek-use-phy_read_paged-instead-of-open-c.patch
@@ -0,0 +1,27 @@
+From 934cdd67e7cf71f97a2a8aea2892e540af47dcdf Mon Sep 17 00:00:00 2001
+From: Daniel Golle <daniel@makrotopia.org>
+Date: Sat, 22 Apr 2023 01:21:14 +0100
+Subject: [PATCH 1/3] net: phy: realtek: use phy_read_paged instead of open
+ coding
+
+Instead of open coding a paged read, use the phy_read_paged function
+in rtlgen_supports_2_5gbps.
+
+Signed-off-by: Daniel Golle <daniel@makrotopia.org>
+---
+ drivers/net/phy/realtek.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+--- a/drivers/net/phy/realtek.c
++++ b/drivers/net/phy/realtek.c
+@@ -727,9 +727,7 @@ static bool rtlgen_supports_2_5gbps(stru
+ {
+ int val;
+
+- phy_write(phydev, RTL821x_PAGE_SELECT, 0xa61);
+- val = phy_read(phydev, 0x13);
+- phy_write(phydev, RTL821x_PAGE_SELECT, 0);
++ val = phy_read_paged(phydev, 0xa61, 0x13);
+
+ return val >= 0 && val & RTL_SUPPORTS_2500FULL;
+ }