summaryrefslogtreecommitdiff
path: root/include/dm
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-09-28 23:32:06 -0600
committerSimon Glass <sjg@chromium.org>2015-10-23 09:42:28 -0600
commit8d1f3a9daf65baf756fe5ada1567710b476341e6 (patch)
tree1b6f36bc23f9c9298a409515d2f669f100f70cb4 /include/dm
parent99b81a4d862cdf6bb5aea283886f17c12bac8019 (diff)
downloadu-boot-imx-8d1f3a9daf65baf756fe5ada1567710b476341e6.zip
u-boot-imx-8d1f3a9daf65baf756fe5ada1567710b476341e6.tar.gz
u-boot-imx-8d1f3a9daf65baf756fe5ada1567710b476341e6.tar.bz2
dm: core: Tidy up comments in device.h
Correct a few nits found in a recent review. Expand the comments in dev_get_driver_data() to make it clearer. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/device.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/include/dm/device.h b/include/dm/device.h
index 0e40aaf..28ba4ca 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -278,13 +278,26 @@ struct udevice *dev_get_parent(struct udevice *child);
* dev_get_driver_data() - get the driver data used to bind a device
*
* When a device is bound using a device tree node, it matches a
- * particular compatible string as in struct udevice_id. This function
+ * particular compatible string in struct udevice_id. This function
* returns the associated data value for that compatible string. This is
* the 'data' field in struct udevice_id.
*
+ * As an example, consider this structure:
+ * static const struct udevice_id tegra_i2c_ids[] = {
+ * { .compatible = "nvidia,tegra114-i2c", .data = TYPE_114 },
+ * { .compatible = "nvidia,tegra20-i2c", .data = TYPE_STD },
+ * { .compatible = "nvidia,tegra20-i2c-dvc", .data = TYPE_DVC },
+ * { }
+ * };
+ *
+ * When driver model finds a driver for this it will store the 'data' value
+ * corresponding to the compatible string it matches. This function returns
+ * that value. This allows the driver to handle several variants of a device.
+ *
* For USB devices, this is the driver_info field in struct usb_device_id.
*
* @dev: Device to check
+ * @return driver data (0 if none is provided)
*/
ulong dev_get_driver_data(struct udevice *dev);
@@ -299,7 +312,7 @@ ulong dev_get_driver_data(struct udevice *dev);
*/
const void *dev_get_driver_ops(struct udevice *dev);
-/*
+/**
* device_get_uclass_id() - return the uclass ID of a device
*
* @dev: Device to check
@@ -307,7 +320,7 @@ const void *dev_get_driver_ops(struct udevice *dev);
*/
enum uclass_id device_get_uclass_id(struct udevice *dev);
-/*
+/**
* dev_get_uclass_name() - return the uclass name of a device
*
* This checks that dev is not NULL.