diff mbox series

[net-next,3/8] net: phy: add getters for public members of struct phy_package_shared

Message ID b505ed6a-533d-42ad-82d0-93315ce27e7f@gmail.com (mailing list archive)
State New
Delegated to: Netdev Maintainers
Headers show
Series net: phy: move PHY package code to its own source file | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1 this patch: 1
netdev/build_tools success Errors and warnings before: 26 (+1) this patch: 26 (+1)
netdev/cc_maintainers success CCed 11 of 11 maintainers
netdev/build_clang success Errors and warnings before: 10 this patch: 10
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 362 this patch: 362
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 27 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 33 this patch: 33
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-02-20--12-00 (tests: 893)

Commit Message

Heiner Kallweit Feb. 19, 2025, 9:04 p.m. UTC
Add getters for public members, this prepares for making struct
phy_package_shared private to phylib.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/phy_package.c | 12 ++++++++++++
 include/linux/phy.h           |  3 +++
 2 files changed, 15 insertions(+)
diff mbox series

Patch

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);