--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
-@@ -1648,6 +1648,7 @@ int phy_package_join(struct phy_device *
+@@ -1698,6 +1698,7 @@ int phy_package_join(struct phy_device *
shared->priv_size = priv_size;
}
shared->base_addr = base_addr;
refcount_set(&shared->refcnt, 1);
bus->shared[base_addr] = shared;
} else {
-@@ -1671,6 +1672,63 @@ err_unlock:
+@@ -1721,6 +1722,63 @@ err_unlock:
EXPORT_SYMBOL_GPL(phy_package_join);
/**
* phy_package_leave - leave a common PHY group
* @phydev: target phy_device struct
*
-@@ -1686,6 +1744,10 @@ void phy_package_leave(struct phy_device
+@@ -1736,6 +1794,10 @@ void phy_package_leave(struct phy_device
if (!shared)
return;
if (refcount_dec_and_mutex_lock(&shared->refcnt, &bus->shared_lock)) {
bus->shared[shared->base_addr] = NULL;
mutex_unlock(&bus->shared_lock);
-@@ -1739,6 +1801,40 @@ int devm_phy_package_join(struct device
+@@ -1789,6 +1851,40 @@ int devm_phy_package_join(struct device
EXPORT_SYMBOL_GPL(devm_phy_package_join);
/**
*
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
-@@ -321,6 +321,7 @@ struct mdio_bus_stats {
+@@ -329,6 +329,7 @@ struct mdio_bus_stats {
* struct phy_package_shared - Shared information in PHY packages
* @base_addr: Base PHY address of PHY package used to combine PHYs
* in one package and for offset calculation of phy_package_read/write
* @refcnt: Number of PHYs connected to this shared data
* @flags: Initialization of PHY package
* @priv_size: Size of the shared private data @priv
-@@ -332,6 +333,8 @@ struct mdio_bus_stats {
+@@ -340,6 +341,8 @@ struct mdio_bus_stats {
*/
struct phy_package_shared {
u8 base_addr;