summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-10-03 09:25:20 -0600
committerSimon Glass <sjg@chromium.org>2020-10-29 14:42:17 -0600
commit3c14083f20679c526f3a133b2f71f0aad996fdc8 (patch)
treef7bfd88f5c3d095793f1464d8b9579f0a38b2675 /include
parent97136eb5354c28c475cd2fb72d5cc1029ce9e743 (diff)
downloadu-boot-3c14083f20679c526f3a133b2f71f0aad996fdc8.tar.gz
u-boot-3c14083f20679c526f3a133b2f71f0aad996fdc8.tar.xz
u-boot-3c14083f20679c526f3a133b2f71f0aad996fdc8.zip
dm: core: Expand the comment for DM_GET_DEVICE()
The current documentation for this is not particularly enlightening. Add a little more detail. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/dm/platdata.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/dm/platdata.h b/include/dm/platdata.h
index cab93b071b..25479b03d2 100644
--- a/include/dm/platdata.h
+++ b/include/dm/platdata.h
@@ -45,7 +45,22 @@ struct driver_info {
#define U_BOOT_DEVICES(__name) \
ll_entry_declare_list(struct driver_info, __name, driver_info)
-/* Get a pointer to a given driver */
+/**
+ * Get a pointer to a given device info given its name
+ *
+ * With the declaration U_BOOT_DEVICE(name), DM_GET_DEVICE(name) will return a
+ * pointer to the struct driver_info created by that declaration.
+ *
+ * if OF_PLATDATA is enabled, from this it is possible to use the @dev member of
+ * struct driver_info to find the device pointer itself.
+ *
+ * TODO(sjg@chromium.org): U_BOOT_DEVICE() tells U-Boot to create a device, so
+ * the naming seems sensible, but DM_GET_DEVICE() is a bit of misnomer, since it
+ * finds the driver_info record, not the device.
+ *
+ * @__name: Driver name (C identifier, not a string. E.g. gpio7_at_ff7e0000)
+ * @return struct driver_info * to the driver that created the device
+ */
#define DM_GET_DEVICE(__name) \
ll_entry_get(struct driver_info, __name, driver_info)