realtek: phy: 6.18: drop shared priv access helper

Between v6.12 and v6.18, struct phy_package_shared was moved from
include/linux/phylib.h to drivers/net/phy/phy_package.c and thus made
internal/unavailable for other drivers.

Our PHY driver used a helper to access the shared priv. With v6.18, it
doesn't work anymore (due to missing access to internal fields of struct
phy_package_shared) but upstream has an equivalent helper for that. Drop
ours and use the upstream helper.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21181
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Jonas Jelonek
2026-03-29 18:08:21 +02:00
committed by Robert Marko
parent 370a84eff2
commit 48f90025a0
2 changed files with 4 additions and 7 deletions
@@ -14,6 +14,7 @@
#include <linux/sfp.h>
#include <linux/mii.h>
#include <linux/mdio.h>
#include "../phylib.h"
/*
* Realtek PHYs have three special page registers. Register 31 (page select) switches the
@@ -67,12 +68,6 @@ struct rtl821x_shared_priv {
int ports;
};
/* TODO: for kernel 6.18 drop this function and use it from phy_package library instead */
static void *phy_package_get_priv(struct phy_device *phydev)
{
return phydev->shared->priv;
}
static int rtl821x_package_join(struct phy_device *phydev, int ports)
{
struct rtl821x_shared_priv *shared_priv;
@@ -16,12 +16,14 @@ Submitted-by: Birger Koblitz <mail@birger-koblitz.de>
+obj-$(CONFIG_REALTEK_PHY_MULTIPORT) += realtek_multiport.o
--- a/drivers/net/phy/realtek/Kconfig
+++ b/drivers/net/phy/realtek/Kconfig
@@ -5,6 +5,11 @@ config REALTEK_PHY
@@ -5,6 +5,13 @@ config REALTEK_PHY
help
Currently supports RTL821x/RTL822x and fast ethernet PHYs
+config REALTEK_PHY_MULTIPORT
+ tristate "Realtek multiport PHYs"
+ depends on PHYLIB
+ select PHY_PACKAGE
+ help
+ Currently supports RTL8214x/RTL8218x gigabit multiport PHYs
+