[PATCH net-next 3/8] net: phy: add getters for public members of struct phy_package_shared
Heiner Kallweit
hkallweit1 at gmail.com
Wed Feb 19 13:04:47 PST 2025
Add getters for public members, this prepares for making struct
phy_package_shared private to phylib.
Signed-off-by: Heiner Kallweit <hkallweit1 at gmail.com>
---
drivers/net/phy/phy_package.c | 12 ++++++++++++
include/linux/phy.h | 3 +++
2 files changed, 15 insertions(+)
diff --git a/drivers/net/phy/phy_package.c b/drivers/net/phy/phy_package.c
index 9b9c200ae..6955b4132 100644
--- a/drivers/net/phy/phy_package.c
+++ b/drivers/net/phy/phy_package.c
@@ -6,6 +6,18 @@
#include <linux/of.h>
#include <linux/phy.h>
+struct device_node *phy_package_shared_get_node(struct phy_device *phydev)
+{
+ return phydev->shared->np;
+}
+EXPORT_SYMBOL_GPL(phy_package_shared_get_node);
+
+void *phy_package_shared_get_priv(struct phy_device *phydev)
+{
+ return phydev->shared->priv;
+}
+EXPORT_SYMBOL_GPL(phy_package_shared_get_priv);
+
int phy_package_address(struct phy_device *phydev, unsigned int addr_offset)
{
struct phy_package_shared *shared = phydev->shared;
diff --git a/include/linux/phy.h b/include/linux/phy.h
index a8f39e817..ce591307a 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -2095,6 +2095,9 @@ int phy_ethtool_get_link_ksettings(struct net_device *ndev,
int phy_ethtool_set_link_ksettings(struct net_device *ndev,
const struct ethtool_link_ksettings *cmd);
int phy_ethtool_nway_reset(struct net_device *ndev);
+
+struct device_node *phy_package_shared_get_node(struct phy_device *phydev);
+void *phy_package_shared_get_priv(struct phy_device *phydev);
int phy_package_join(struct phy_device *phydev, int base_addr, size_t priv_size);
int of_phy_package_join(struct phy_device *phydev, size_t priv_size);
void phy_package_leave(struct phy_device *phydev);
--
2.48.1
More information about the linux-arm-kernel
mailing list