Commit f2bc6fc3316d85dcd36d88788c3c412213c7823c
1 parent
47f3d3c80b
Exists in
v2017.01-smarct4x
and in
40 other branches
dm: Tidy up four minor code nits
There is a spelling mistake and two functions are missing comments altogether. Also the flags declaration is correct, but doesn't follow style. Finally, the uclass_get_device() function has some errors in its documentation. Fix these problems. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Marek Vasut <marex@denx.de>
Showing 4 changed files with 28 additions and 6 deletions Side-by-side Diff
include/dm/device.h
include/dm/lists.h
... | ... | @@ -32,8 +32,28 @@ |
32 | 32 | */ |
33 | 33 | struct uclass_driver *lists_uclass_lookup(enum uclass_id id); |
34 | 34 | |
35 | +/** | |
36 | + * lists_bind_drivers() - search for and bind all drivers to parent | |
37 | + * | |
38 | + * This searches the U_BOOT_DEVICE() structures and creates new devices for | |
39 | + * each one. The devices will have @parent as their parent. | |
40 | + * | |
41 | + * @parent: parent driver (root) | |
42 | + * @early_only: If true, bind only drivers with the DM_INIT_F flag. If false | |
43 | + * bind all drivers. | |
44 | + */ | |
35 | 45 | int lists_bind_drivers(struct udevice *parent); |
36 | 46 | |
47 | +/** | |
48 | + * lists_bind_fdt() - bind a device tree node | |
49 | + * | |
50 | + * This creates a new device bound to the given device tree node, with | |
51 | + * @parent as its parent. | |
52 | + * | |
53 | + * @parent: parent driver (root) | |
54 | + * @blob: device tree blob | |
55 | + * @offset: offset of this device tree node | |
56 | + */ | |
37 | 57 | int lists_bind_fdt(struct udevice *parent, const void *blob, int offset); |
38 | 58 | |
39 | 59 | #endif |
include/dm/root.h
... | ... | @@ -41,7 +41,7 @@ |
41 | 41 | int dm_scan_fdt(const void *blob); |
42 | 42 | |
43 | 43 | /** |
44 | - * dm_init() - Initialize Driver Model structures | |
44 | + * dm_init() - Initialise Driver Model structures | |
45 | 45 | * |
46 | 46 | * This function will initialize roots of driver tree and class tree. |
47 | 47 | * This needs to be called before anything uses the DM |
include/dm/uclass.h
... | ... | @@ -26,7 +26,7 @@ |
26 | 26 | * @priv: Private data for this uclass |
27 | 27 | * @uc_drv: The driver for the uclass itself, not to be confused with a |
28 | 28 | * 'struct driver' |
29 | - * dev_head: List of devices in this uclass (devices are attached to their | |
29 | + * @dev_head: List of devices in this uclass (devices are attached to their | |
30 | 30 | * uclass when their bind method is called) |
31 | 31 | * @sibling_node: Next uclass in the linked list of uclasses |
32 | 32 | */ |
33 | 33 | |
34 | 34 | |
... | ... | @@ -96,12 +96,14 @@ |
96 | 96 | /** |
97 | 97 | * uclass_get_device() - Get a uclass device based on an ID and index |
98 | 98 | * |
99 | + * The device is probed to activate it ready for use. | |
100 | + * | |
99 | 101 | * id: ID to look up |
100 | 102 | * @index: Device number within that uclass (0=first) |
101 | - * @ucp: Returns pointer to uclass (there is only one per for each ID) | |
103 | + * @devp: Returns pointer to device (there is only one per for each ID) | |
102 | 104 | * @return 0 if OK, -ve on error |
103 | 105 | */ |
104 | -int uclass_get_device(enum uclass_id id, int index, struct udevice **ucp); | |
106 | +int uclass_get_device(enum uclass_id id, int index, struct udevice **devp); | |
105 | 107 | |
106 | 108 | /** |
107 | 109 | * uclass_first_device() - Get the first device in a uclass |
... | ... | @@ -129,7 +131,7 @@ |
129 | 131 | * |
130 | 132 | * @pos: struct udevice * to hold the current device. Set to NULL when there |
131 | 133 | * are no more devices. |
132 | - * uc: uclass to scan | |
134 | + * @uc: uclass to scan | |
133 | 135 | */ |
134 | 136 | #define uclass_foreach_dev(pos, uc) \ |
135 | 137 | for (pos = list_entry((&(uc)->dev_head)->next, typeof(*pos), \ |