summaryrefslogtreecommitdiff
path: root/include/dm
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-03-05 12:25:20 -0700
committerSimon Glass <sjg@chromium.org>2015-04-16 19:27:42 -0600
commite564f054af002d9e6a1080ed9d4bc2c6052a4435 (patch)
tree7b945d568d32c7febf5a8b70c6bce26b5157663c /include/dm
parent106cce9604306743c86addd4d27426cce498c9d1 (diff)
downloadu-boot-imx-e564f054af002d9e6a1080ed9d4bc2c6052a4435.zip
u-boot-imx-e564f054af002d9e6a1080ed9d4bc2c6052a4435.tar.gz
u-boot-imx-e564f054af002d9e6a1080ed9d4bc2c6052a4435.tar.bz2
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>
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/device.h10
1 files changed, 10 insertions, 0 deletions
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