Lines Matching full:shared

13  * struct phy_package_shared - Shared information in PHY packages
17 * @refcnt: Number of PHYs connected to this shared data
19 * @priv_size: Size of the shared private data @priv
20 * @priv: Driver private data shared across a PHY package
22 * Represents a shared structure between different phydev's in the same
35 /* note that this pointer is shared between different phydevs and
45 return phydev->shared->np; in phy_package_get_node()
51 return phydev->shared->priv; in phy_package_get_priv()
57 struct phy_package_shared *shared = phydev->shared; in phy_package_address() local
58 u8 base_addr = shared->base_addr; in phy_package_address()
95 struct phy_package_shared *shared = phydev->shared; in __phy_package_set_once() local
97 if (!shared) in __phy_package_set_once()
100 return !test_and_set_bit(b, &shared->flags); in __phy_package_set_once()
122 * This joins a PHY group and provides a shared storage for all phydevs in
135 * This will set the shared pointer of the phydev to the shared storage.
136 * If this is the first call for a this cookie the shared storage will be
146 struct phy_package_shared *shared; in phy_package_join() local
153 shared = bus->shared[base_addr]; in phy_package_join()
154 if (!shared) { in phy_package_join()
156 shared = kzalloc(sizeof(*shared), GFP_KERNEL); in phy_package_join()
157 if (!shared) in phy_package_join()
160 shared->priv = kzalloc(priv_size, GFP_KERNEL); in phy_package_join()
161 if (!shared->priv) in phy_package_join()
163 shared->priv_size = priv_size; in phy_package_join()
165 shared->base_addr = base_addr; in phy_package_join()
166 shared->np = NULL; in phy_package_join()
167 refcount_set(&shared->refcnt, 1); in phy_package_join()
168 bus->shared[base_addr] = shared; in phy_package_join()
171 if (priv_size && priv_size != shared->priv_size) in phy_package_join()
173 refcount_inc(&shared->refcnt); in phy_package_join()
177 phydev->shared = shared; in phy_package_join()
182 kfree(shared); in phy_package_join()
200 * With this configuration the shared struct will also have the np value
237 phydev->shared->np = package_node; in of_phy_package_join()
251 * was the last user of the shared data between the group, this data is
252 * freed. Resets the phydev->shared pointer to NULL.
256 struct phy_package_shared *shared = phydev->shared; in phy_package_leave() local
259 if (!shared) in phy_package_leave()
263 if (shared->np) in phy_package_leave()
264 of_node_put(shared->np); in phy_package_leave()
266 if (refcount_dec_and_mutex_lock(&shared->refcnt, &bus->shared_lock)) { in phy_package_leave()
267 bus->shared[shared->base_addr] = NULL; in phy_package_leave()
269 kfree(shared->priv); in phy_package_leave()
270 kfree(shared); in phy_package_leave()
273 phydev->shared = NULL; in phy_package_leave()
290 * Managed phy_package_join(). Shared storage fetched by this function,
324 * Managed of_phy_package_join(). Shared storage fetched by this function,