From e564f054af002d9e6a1080ed9d4bc2c6052a4435 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 5 Mar 2015 12:25:20 -0700 Subject: 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 --- include/dm/device.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/dm/device.h') diff --git a/include/dm/device.h b/include/dm/device.h index 7a48eb8..6980954 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -238,6 +238,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 * * When a device is bound using a device tree node, it matches a -- cgit v1.1