dm: core: Add dev_get_uclass_priv() to access uclass private data
Add a convenience function to access the private data that a uclass stores for each of its devices. Convert over most existing uses for consistency and to provide an example for others. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -237,6 +237,16 @@ void *dev_get_priv(struct udevice *dev);
|
||||
*/
|
||||
struct udevice *dev_get_parent(struct udevice *child);
|
||||
|
||||
/**
|
||||
* dev_get_uclass_priv() - Get the private uclass data for a device
|
||||
*
|
||||
* This checks that dev is not NULL, but no other checks for now
|
||||
*
|
||||
* @dev Device to check
|
||||
* @return private uclass data for this device, or NULL if none
|
||||
*/
|
||||
void *dev_get_uclass_priv(struct udevice *dev);
|
||||
|
||||
/**
|
||||
* dev_get_of_data() - get the device tree data used to bind a device
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user