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()
58 struct phy_package_shared *shared = phydev->shared; in phy_package_address() local
59 u8 base_addr = shared->base_addr; in phy_package_address()
161 struct phy_package_shared *shared = phydev->shared; in __phy_package_set_once() local
163 if (!shared) in __phy_package_set_once()
166 return !test_and_set_bit(b, &shared->flags); in __phy_package_set_once()
188 * This joins a PHY group and provides a shared storage for all phydevs in
201 * This will set the shared pointer of the phydev to the shared storage.
202 * If this is the first call for a this cookie the shared storage will be
212 struct phy_package_shared *shared; in phy_package_join() local
219 shared = bus->shared[base_addr]; in phy_package_join()
220 if (!shared) { in phy_package_join()
222 shared = kzalloc(sizeof(*shared), GFP_KERNEL); in phy_package_join()
223 if (!shared) in phy_package_join()
226 shared->priv = kzalloc(priv_size, GFP_KERNEL); in phy_package_join()
227 if (!shared->priv) in phy_package_join()
229 shared->priv_size = priv_size; in phy_package_join()
231 shared->base_addr = base_addr; in phy_package_join()
232 shared->np = NULL; in phy_package_join()
233 refcount_set(&shared->refcnt, 1); in phy_package_join()
234 bus->shared[base_addr] = shared; in phy_package_join()
237 if (priv_size && priv_size != shared->priv_size) in phy_package_join()
239 refcount_inc(&shared->refcnt); in phy_package_join()
243 phydev->shared = shared; in phy_package_join()
248 kfree(shared); in phy_package_join()
266 * With this configuration the shared struct will also have the np value
303 phydev->shared->np = package_node; in of_phy_package_join()
317 * was the last user of the shared data between the group, this data is
318 * freed. Resets the phydev->shared pointer to NULL.
322 struct phy_package_shared *shared = phydev->shared; in phy_package_leave() local
325 if (!shared) in phy_package_leave()
329 if (shared->np) in phy_package_leave()
330 of_node_put(shared->np); in phy_package_leave()
332 if (refcount_dec_and_mutex_lock(&shared->refcnt, &bus->shared_lock)) { in phy_package_leave()
333 bus->shared[shared->base_addr] = NULL; in phy_package_leave()
335 kfree(shared->priv); in phy_package_leave()
336 kfree(shared); in phy_package_leave()
339 phydev->shared = NULL; in phy_package_leave()
356 * Managed phy_package_join(). Shared storage fetched by this function,
390 * Managed of_phy_package_join(). Shared storage fetched by this function,