9c99ccb1dbb6e8bbce55b41c9b909e070aea79fa
[openwrt/staging/ldir.git] / target / linux / generic / backport-5.10 / 732-v5.13-0006-of-Add-missing-Return-section-in-kerneldoc-comments.patch
1 From 8c8239c2c1fb82f171cb22a707f3bb88a2f22109 Mon Sep 17 00:00:00 2001
2 From: Rob Herring <robh@kernel.org>
3 Date: Thu, 25 Mar 2021 10:47:12 -0600
4 Subject: [PATCH] of: Add missing 'Return' section in kerneldoc comments
5
6 Many of the DT kerneldoc comments are lacking a 'Return' section. Let's
7 add the section in cases we have a description of return values. There's
8 still some cases where the return values are not documented.
9
10 Cc: Frank Rowand <frowand.list@gmail.com>
11 Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
12 Signed-off-by: Rob Herring <robh@kernel.org>
13 Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
14 Link: https://lore.kernel.org/r/20210325164713.1296407-8-robh@kernel.org
15 ---
16 drivers/of/base.c | 39 +++++++++++++------------
17 drivers/of/dynamic.c | 19 ++++++++-----
18 drivers/of/fdt.c | 8 +++---
19 drivers/of/irq.c | 14 ++++-----
20 drivers/of/overlay.c | 16 +++++------
21 drivers/of/platform.c | 10 +++----
22 drivers/of/property.c | 66 +++++++++++++++++++++++++++----------------
23 include/linux/of.h | 63 ++++++++++++++++++++++++++---------------
24 8 files changed, 140 insertions(+), 95 deletions(-)
25
26 --- a/drivers/of/base.c
27 +++ b/drivers/of/base.c
28 @@ -244,7 +244,7 @@ struct device_node *__of_find_all_nodes(
29 * @prev: Previous node or NULL to start iteration
30 * of_node_put() will be called on it
31 *
32 - * Returns a node pointer with refcount incremented, use
33 + * Return: A node pointer with refcount incremented, use
34 * of_node_put() on it when done.
35 */
36 struct device_node *of_find_all_nodes(struct device_node *prev)
37 @@ -374,7 +374,7 @@ bool __weak arch_find_n_match_cpu_physic
38 * before booting secondary cores. This function uses arch_match_cpu_phys_id
39 * which can be overridden by architecture specific implementation.
40 *
41 - * Returns a node pointer for the logical cpu with refcount incremented, use
42 + * Return: A node pointer for the logical cpu with refcount incremented, use
43 * of_node_put() on it when done. Returns NULL if not found.
44 */
45 struct device_node *of_get_cpu_node(int cpu, unsigned int *thread)
46 @@ -394,8 +394,8 @@ EXPORT_SYMBOL(of_get_cpu_node);
47 *
48 * @cpu_node: Pointer to the device_node for CPU.
49 *
50 - * Returns the logical CPU number of the given CPU device_node.
51 - * Returns -ENODEV if the CPU is not found.
52 + * Return: The logical CPU number of the given CPU device_node or -ENODEV if the
53 + * CPU is not found.
54 */
55 int of_cpu_node_to_id(struct device_node *cpu_node)
56 {
57 @@ -427,7 +427,7 @@ EXPORT_SYMBOL(of_cpu_node_to_id);
58 * bindings. This function check for both and returns the idle state node for
59 * the requested index.
60 *
61 - * In case an idle state node is found at @index, the refcount is incremented
62 + * Return: An idle state node if found at @index. The refcount is incremented
63 * for it, so call of_node_put() on it when done. Returns NULL if not found.
64 */
65 struct device_node *of_get_cpu_state_node(struct device_node *cpu_node,
66 @@ -561,7 +561,7 @@ int of_device_compatible_match(struct de
67 * of_machine_is_compatible - Test root of device tree for a given compatible value
68 * @compat: compatible string to look for in root node's compatible property.
69 *
70 - * Returns a positive integer if the root node has the given value in its
71 + * Return: A positive integer if the root node has the given value in its
72 * compatible property.
73 */
74 int of_machine_is_compatible(const char *compat)
75 @@ -583,7 +583,7 @@ EXPORT_SYMBOL(of_machine_is_compatible);
76 *
77 * @device: Node to check for availability, with locks already held
78 *
79 - * Returns true if the status property is absent or set to "okay" or "ok",
80 + * Return: True if the status property is absent or set to "okay" or "ok",
81 * false otherwise
82 */
83 static bool __of_device_is_available(const struct device_node *device)
84 @@ -611,7 +611,7 @@ static bool __of_device_is_available(con
85 *
86 * @device: Node to check for availability
87 *
88 - * Returns true if the status property is absent or set to "okay" or "ok",
89 + * Return: True if the status property is absent or set to "okay" or "ok",
90 * false otherwise
91 */
92 bool of_device_is_available(const struct device_node *device)
93 @@ -632,7 +632,7 @@ EXPORT_SYMBOL(of_device_is_available);
94 *
95 * @device: Node to check for endianness
96 *
97 - * Returns true if the device has a "big-endian" property, or if the kernel
98 + * Return: True if the device has a "big-endian" property, or if the kernel
99 * was compiled for BE *and* the device has a "native-endian" property.
100 * Returns false otherwise.
101 *
102 @@ -816,7 +816,7 @@ EXPORT_SYMBOL(of_get_next_cpu_node);
103 * Lookup child node whose compatible property contains the given compatible
104 * string.
105 *
106 - * Returns a node pointer with refcount incremented, use of_node_put() on it
107 + * Return: a node pointer with refcount incremented, use of_node_put() on it
108 * when done; or NULL if not found.
109 */
110 struct device_node *of_get_compatible_child(const struct device_node *parent,
111 @@ -1170,7 +1170,7 @@ EXPORT_SYMBOL(of_find_matching_node_and_
112 * It does this by stripping the manufacturer prefix (as delimited by a ',')
113 * from the first entry in the compatible list property.
114 *
115 - * This routine returns 0 on success, <0 on failure.
116 + * Return: This routine returns 0 on success, <0 on failure.
117 */
118 int of_modalias_node(struct device_node *node, char *modalias, int len)
119 {
120 @@ -1190,7 +1190,7 @@ EXPORT_SYMBOL_GPL(of_modalias_node);
121 * of_find_node_by_phandle - Find a node given a phandle
122 * @handle: phandle of the node to find
123 *
124 - * Returns a node pointer with refcount incremented, use
125 + * Return: A node pointer with refcount incremented, use
126 * of_node_put() on it when done.
127 */
128 struct device_node *of_find_node_by_phandle(phandle handle)
129 @@ -1431,7 +1431,7 @@ static int __of_parse_phandle_with_args(
130 * @index: For properties holding a table of phandles, this is the index into
131 * the table
132 *
133 - * Returns the device_node pointer with refcount incremented. Use
134 + * Return: The device_node pointer with refcount incremented. Use
135 * of_node_put() on it when done.
136 */
137 struct device_node *of_parse_phandle(const struct device_node *np,
138 @@ -1731,7 +1731,7 @@ EXPORT_SYMBOL(of_parse_phandle_with_fixe
139 * @list_name: property name that contains a list
140 * @cells_name: property name that specifies phandles' arguments count
141 *
142 - * Returns the number of phandle + argument tuples within a property. It
143 + * Return: The number of phandle + argument tuples within a property. It
144 * is a typical pattern to encode a list of phandle and variable
145 * arguments into a single property. The number of arguments is encoded
146 * by a property in the phandle-target node. For example, a gpios
147 @@ -2031,7 +2031,9 @@ void of_alias_scan(void * (*dt_alloc)(u6
148 * @stem: Alias stem of the given device_node
149 *
150 * The function travels the lookup table to get the alias id for the given
151 - * device_node and alias stem. It returns the alias id if found.
152 + * device_node and alias stem.
153 + *
154 + * Return: The alias id if found.
155 */
156 int of_alias_get_id(struct device_node *np, const char *stem)
157 {
158 @@ -2140,8 +2142,9 @@ EXPORT_SYMBOL_GPL(of_alias_get_highest_i
159 * @index: Index to use for preferred console.
160 *
161 * Check if the given device node matches the stdout-path property in the
162 - * /chosen node. If it does then register it as the preferred console and return
163 - * TRUE. Otherwise return FALSE.
164 + * /chosen node. If it does then register it as the preferred console.
165 + *
166 + * Return: TRUE if console successfully setup. Otherwise return FALSE.
167 */
168 bool of_console_check(struct device_node *dn, char *name, int index)
169 {
170 @@ -2192,7 +2195,7 @@ struct device_node *of_find_next_cache_n
171 *
172 * @cpu: cpu number(logical index) for which the last cache level is needed
173 *
174 - * Returns the the level at which the last cache is present. It is exactly
175 + * Return: The the level at which the last cache is present. It is exactly
176 * same as the total number of cache levels for the given logical cpu.
177 */
178 int of_find_last_cache_level(unsigned int cpu)
179 --- a/drivers/of/dynamic.c
180 +++ b/drivers/of/dynamic.c
181 @@ -27,7 +27,7 @@ static struct device_node *kobj_to_devic
182 * @node: Node to inc refcount, NULL is supported to simplify writing of
183 * callers
184 *
185 - * Returns node.
186 + * Return: The node with refcount incremented.
187 */
188 struct device_node *of_node_get(struct device_node *node)
189 {
190 @@ -104,7 +104,8 @@ int of_reconfig_notify(unsigned long act
191 * @arg - argument of the of notifier
192 *
193 * Returns the new state of a device based on the notifier used.
194 - * Returns 0 on device going from enabled to disabled, 1 on device
195 + *
196 + * Return: 0 on device going from enabled to disabled, 1 on device
197 * going from disabled to enabled and -1 on no change.
198 */
199 int of_reconfig_get_state_change(unsigned long action, struct of_reconfig_data *pr)
200 @@ -371,7 +372,8 @@ void of_node_release(struct kobject *kob
201 * property structure and the property name & contents. The property's
202 * flags have the OF_DYNAMIC bit set so that we can differentiate between
203 * dynamically allocated properties and not.
204 - * Returns the newly allocated property or NULL on out of memory error.
205 + *
206 + * Return: The newly allocated property or NULL on out of memory error.
207 */
208 struct property *__of_prop_dup(const struct property *prop, gfp_t allocflags)
209 {
210 @@ -414,7 +416,7 @@ struct property *__of_prop_dup(const str
211 * another node. The node data are dynamically allocated and all the node
212 * flags have the OF_DYNAMIC & OF_DETACHED bits set.
213 *
214 - * Returns the newly allocated node or NULL on out of memory error.
215 + * Return: The newly allocated node or NULL on out of memory error.
216 */
217 struct device_node *__of_node_dup(const struct device_node *np,
218 const char *full_name)
219 @@ -780,7 +782,8 @@ static int __of_changeset_apply(struct o
220 * Any side-effects of live tree state changes are applied here on
221 * success, like creation/destruction of devices and side-effects
222 * like creation of sysfs properties and directories.
223 - * Returns 0 on success, a negative error value in case of an error.
224 + *
225 + * Return: 0 on success, a negative error value in case of an error.
226 * On error the partially applied effects are reverted.
227 */
228 int of_changeset_apply(struct of_changeset *ocs)
229 @@ -874,7 +877,8 @@ static int __of_changeset_revert(struct
230 * was before the application.
231 * Any side-effects like creation/destruction of devices and
232 * removal of sysfs properties and directories are applied.
233 - * Returns 0 on success, a negative error value in case of an error.
234 + *
235 + * Return: 0 on success, a negative error value in case of an error.
236 */
237 int of_changeset_revert(struct of_changeset *ocs)
238 {
239 @@ -902,7 +906,8 @@ EXPORT_SYMBOL_GPL(of_changeset_revert);
240 * + OF_RECONFIG_ADD_PROPERTY
241 * + OF_RECONFIG_REMOVE_PROPERTY,
242 * + OF_RECONFIG_UPDATE_PROPERTY
243 - * Returns 0 on success, a negative error value in case of an error.
244 + *
245 + * Return: 0 on success, a negative error value in case of an error.
246 */
247 int of_changeset_action(struct of_changeset *ocs, unsigned long action,
248 struct device_node *np, struct property *prop)
249 --- a/drivers/of/fdt.c
250 +++ b/drivers/of/fdt.c
251 @@ -282,7 +282,7 @@ static void reverse_nodes(struct device_
252 * @dad: Parent struct device_node
253 * @nodepp: The device_node tree created by the call
254 *
255 - * It returns the size of unflattened device tree or error code
256 + * Return: The size of unflattened device tree or error code
257 */
258 static int unflatten_dt_nodes(const void *blob,
259 void *mem,
260 @@ -360,7 +360,7 @@ static int unflatten_dt_nodes(const void
261 * fills the "name" and "type" pointers of the nodes so the normal device-tree
262 * walking functions can be used.
263 *
264 - * Returns NULL on failure or the memory chunk containing the unflattened
265 + * Return: NULL on failure or the memory chunk containing the unflattened
266 * device tree on success.
267 */
268 void *__unflatten_device_tree(const void *blob,
269 @@ -441,7 +441,7 @@ static DEFINE_MUTEX(of_fdt_unflatten_mut
270 * pointers of the nodes so the normal device-tree walking functions
271 * can be used.
272 *
273 - * Returns NULL on failure or the memory chunk containing the unflattened
274 + * Return: NULL on failure or the memory chunk containing the unflattened
275 * device tree on success.
276 */
277 void *of_fdt_unflatten_tree(const unsigned long *blob,
278 @@ -715,7 +715,7 @@ const void *__init of_get_flat_dt_prop(u
279 * @node: node to test
280 * @compat: compatible string to compare with compatible list.
281 *
282 - * On match, returns a non-zero value with smaller values returned for more
283 + * Return: a non-zero value on match with smaller values returned for more
284 * specific compatible values.
285 */
286 static int of_fdt_is_compatible(const void *blob,
287 --- a/drivers/of/irq.c
288 +++ b/drivers/of/irq.c
289 @@ -48,7 +48,7 @@ EXPORT_SYMBOL_GPL(irq_of_parse_and_map);
290 * of_irq_find_parent - Given a device node, find its interrupt parent node
291 * @child: pointer to device node
292 *
293 - * Returns a pointer to the interrupt parent node, or NULL if the interrupt
294 + * Return: A pointer to the interrupt parent node, or NULL if the interrupt
295 * parent could not be determined.
296 */
297 struct device_node *of_irq_find_parent(struct device_node *child)
298 @@ -81,14 +81,14 @@ EXPORT_SYMBOL_GPL(of_irq_find_parent);
299 * @addr: address specifier (start of "reg" property of the device) in be32 format
300 * @out_irq: structure of_phandle_args updated by this function
301 *
302 - * Returns 0 on success and a negative number on error
303 - *
304 * This function is a low-level interrupt tree walking function. It
305 * can be used to do a partial walk with synthetized reg and interrupts
306 * properties, for example when resolving PCI interrupts when no device
307 * node exist for the parent. It takes an interrupt specifier structure as
308 * input, walks the tree looking for any interrupt-map properties, translates
309 * the specifier for each map, and then returns the translated map.
310 + *
311 + * Return: 0 on success and a negative number on error
312 */
313 int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq)
314 {
315 @@ -380,7 +380,7 @@ EXPORT_SYMBOL_GPL(of_irq_to_resource);
316 * @dev: pointer to device tree node
317 * @index: zero-based index of the IRQ
318 *
319 - * Returns Linux IRQ number on success, or 0 on the IRQ mapping failure, or
320 + * Return: Linux IRQ number on success, or 0 on the IRQ mapping failure, or
321 * -EPROBE_DEFER if the IRQ domain is not yet created, or error code in case
322 * of any other failure.
323 */
324 @@ -407,7 +407,7 @@ EXPORT_SYMBOL_GPL(of_irq_get);
325 * @dev: pointer to device tree node
326 * @name: IRQ name
327 *
328 - * Returns Linux IRQ number on success, or 0 on the IRQ mapping failure, or
329 + * Return: Linux IRQ number on success, or 0 on the IRQ mapping failure, or
330 * -EPROBE_DEFER if the IRQ domain is not yet created, or error code in case
331 * of any other failure.
332 */
333 @@ -447,7 +447,7 @@ int of_irq_count(struct device_node *dev
334 * @res: array of resources to fill in
335 * @nr_irqs: the number of IRQs (and upper bound for num of @res elements)
336 *
337 - * Returns the size of the filled in table (up to @nr_irqs).
338 + * Return: The size of the filled in table (up to @nr_irqs).
339 */
340 int of_irq_to_resource_table(struct device_node *dev, struct resource *res,
341 int nr_irqs)
342 @@ -602,7 +602,7 @@ static u32 __of_msi_map_id(struct device
343 * Walk up the device hierarchy looking for devices with a "msi-map"
344 * property. If found, apply the mapping to @id_in.
345 *
346 - * Returns the mapped MSI ID.
347 + * Return: The mapped MSI ID.
348 */
349 u32 of_msi_map_id(struct device *dev, struct device_node *msi_np, u32 id_in)
350 {
351 --- a/drivers/of/overlay.c
352 +++ b/drivers/of/overlay.c
353 @@ -296,7 +296,7 @@ err_free_target_path:
354 *
355 * Update of property in symbols node is not allowed.
356 *
357 - * Returns 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
358 + * Return: 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
359 * invalid @overlay.
360 */
361 static int add_changeset_property(struct overlay_changeset *ovcs,
362 @@ -401,7 +401,7 @@ static int add_changeset_property(struct
363 *
364 * NOTE_2: Multiple mods of created nodes not supported.
365 *
366 - * Returns 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
367 + * Return: 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
368 * invalid @overlay.
369 */
370 static int add_changeset_node(struct overlay_changeset *ovcs,
371 @@ -473,7 +473,7 @@ static int add_changeset_node(struct ove
372 *
373 * Do not allow symbols node to have any children.
374 *
375 - * Returns 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
376 + * Return: 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
377 * invalid @overlay_node.
378 */
379 static int build_changeset_next_level(struct overlay_changeset *ovcs,
380 @@ -604,7 +604,7 @@ static int find_dup_cset_prop(struct ove
381 * the same node or duplicate {add, delete, or update} properties entries
382 * for the same property.
383 *
384 - * Returns 0 on success, or -EINVAL if duplicate changeset entry found.
385 + * Return: 0 on success, or -EINVAL if duplicate changeset entry found.
386 */
387 static int changeset_dup_entry_check(struct overlay_changeset *ovcs)
388 {
389 @@ -628,7 +628,7 @@ static int changeset_dup_entry_check(str
390 * any portions of the changeset that were successfully created will remain
391 * in @ovcs->cset.
392 *
393 - * Returns 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
394 + * Return: 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
395 * invalid overlay in @ovcs->fragments[].
396 */
397 static int build_changeset(struct overlay_changeset *ovcs)
398 @@ -724,7 +724,7 @@ static struct device_node *find_target(s
399 * the top level of @tree. The relevant top level nodes are the fragment
400 * nodes and the __symbols__ node. Any other top level node will be ignored.
401 *
402 - * Returns 0 on success, -ENOMEM if memory allocation failure, -EINVAL if error
403 + * Return: 0 on success, -ENOMEM if memory allocation failure, -EINVAL if error
404 * detected in @tree, or -ENOSPC if idr_alloc() error.
405 */
406 static int init_overlay_changeset(struct overlay_changeset *ovcs,
407 @@ -1179,7 +1179,7 @@ static int overlay_removal_is_ok(struct
408 * If an error is returned by an overlay changeset post-remove notifier
409 * then no further overlay changeset post-remove notifier will be called.
410 *
411 - * Returns 0 on success, or a negative error number. *ovcs_id is set to
412 + * Return: 0 on success, or a negative error number. *ovcs_id is set to
413 * zero after reverting the changeset, even if a subsequent error occurs.
414 */
415 int of_overlay_remove(int *ovcs_id)
416 @@ -1257,7 +1257,7 @@ EXPORT_SYMBOL_GPL(of_overlay_remove);
417 *
418 * Removes all overlays from the system in the correct order.
419 *
420 - * Returns 0 on success, or a negative error number
421 + * Return: 0 on success, or a negative error number
422 */
423 int of_overlay_remove_all(void)
424 {
425 --- a/drivers/of/platform.c
426 +++ b/drivers/of/platform.c
427 @@ -44,7 +44,7 @@ static const struct of_device_id of_skip
428 * Takes a reference to the embedded struct device which needs to be dropped
429 * after use.
430 *
431 - * Returns platform_device pointer, or NULL if not found
432 + * Return: platform_device pointer, or NULL if not found
433 */
434 struct platform_device *of_find_device_by_node(struct device_node *np)
435 {
436 @@ -160,7 +160,7 @@ EXPORT_SYMBOL(of_device_alloc);
437 * @platform_data: pointer to populate platform_data pointer with
438 * @parent: Linux device model parent device.
439 *
440 - * Returns pointer to created platform device, or NULL if a device was not
441 + * Return: Pointer to created platform device, or NULL if a device was not
442 * registered. Unavailable devices will not get registered.
443 */
444 static struct platform_device *of_platform_device_create_pdata(
445 @@ -204,7 +204,7 @@ err_clear_flag:
446 * @bus_id: name to assign device
447 * @parent: Linux device model parent device.
448 *
449 - * Returns pointer to created platform device, or NULL if a device was not
450 + * Return: Pointer to created platform device, or NULL if a device was not
451 * registered. Unavailable devices will not get registered.
452 */
453 struct platform_device *of_platform_device_create(struct device_node *np,
454 @@ -463,7 +463,7 @@ EXPORT_SYMBOL(of_platform_bus_probe);
455 * New board support should be using this function instead of
456 * of_platform_bus_probe().
457 *
458 - * Returns 0 on success, < 0 on failure.
459 + * Return: 0 on success, < 0 on failure.
460 */
461 int of_platform_populate(struct device_node *root,
462 const struct of_device_id *matches,
463 @@ -608,7 +608,7 @@ static void devm_of_platform_populate_re
464 * Similar to of_platform_populate(), but will automatically call
465 * of_platform_depopulate() when the device is unbound from the bus.
466 *
467 - * Returns 0 on success, < 0 on failure.
468 + * Return: 0 on success, < 0 on failure.
469 */
470 int devm_of_platform_populate(struct device *dev)
471 {
472 --- a/drivers/of/property.c
473 +++ b/drivers/of/property.c
474 @@ -60,9 +60,11 @@ EXPORT_SYMBOL(of_graph_is_present);
475 * @elem_size: size of the individual element
476 *
477 * Search for a property in a device node and count the number of elements of
478 - * size elem_size in it. Returns number of elements on sucess, -EINVAL if the
479 - * property does not exist or its length does not match a multiple of elem_size
480 - * and -ENODATA if the property does not have a value.
481 + * size elem_size in it.
482 + *
483 + * Return: The number of elements on sucess, -EINVAL if the property does not
484 + * exist or its length does not match a multiple of elem_size and -ENODATA if
485 + * the property does not have a value.
486 */
487 int of_property_count_elems_of_size(const struct device_node *np,
488 const char *propname, int elem_size)
489 @@ -94,8 +96,9 @@ EXPORT_SYMBOL_GPL(of_property_count_elem
490 * @len: if !=NULL, actual length is written to here
491 *
492 * Search for a property in a device node and valid the requested size.
493 - * Returns the property value on success, -EINVAL if the property does not
494 - * exist, -ENODATA if property does not have a value, and -EOVERFLOW if the
495 + *
496 + * Return: The property value on success, -EINVAL if the property does not
497 + * exist, -ENODATA if property does not have a value, and -EOVERFLOW if the
498 * property data is too small or too large.
499 *
500 */
501 @@ -128,7 +131,9 @@ static void *of_find_property_value_of_s
502 * @out_value: pointer to return value, modified only if no error.
503 *
504 * Search for a property in a device node and read nth 32-bit value from
505 - * it. Returns 0 on success, -EINVAL if the property does not exist,
506 + * it.
507 + *
508 + * Return: 0 on success, -EINVAL if the property does not exist,
509 * -ENODATA if property does not have a value, and -EOVERFLOW if the
510 * property data isn't large enough.
511 *
512 @@ -160,7 +165,9 @@ EXPORT_SYMBOL_GPL(of_property_read_u32_i
513 * @out_value: pointer to return value, modified only if no error.
514 *
515 * Search for a property in a device node and read nth 64-bit value from
516 - * it. Returns 0 on success, -EINVAL if the property does not exist,
517 + * it.
518 + *
519 + * Return: 0 on success, -EINVAL if the property does not exist,
520 * -ENODATA if property does not have a value, and -EOVERFLOW if the
521 * property data isn't large enough.
522 *
523 @@ -195,12 +202,14 @@ EXPORT_SYMBOL_GPL(of_property_read_u64_i
524 * sz_min will be read.
525 *
526 * Search for a property in a device node and read 8-bit value(s) from
527 - * it. Returns number of elements read on success, -EINVAL if the property
528 - * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
529 - * if the property data is smaller than sz_min or longer than sz_max.
530 + * it.
531 *
532 * dts entry of array should be like:
533 - * property = /bits/ 8 <0x50 0x60 0x70>;
534 + * ``property = /bits/ 8 <0x50 0x60 0x70>;``
535 + *
536 + * Return: The number of elements read on success, -EINVAL if the property
537 + * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
538 + * if the property data is smaller than sz_min or longer than sz_max.
539 *
540 * The out_values is modified only if a valid u8 value can be decoded.
541 */
542 @@ -243,12 +252,14 @@ EXPORT_SYMBOL_GPL(of_property_read_varia
543 * sz_min will be read.
544 *
545 * Search for a property in a device node and read 16-bit value(s) from
546 - * it. Returns number of elements read on success, -EINVAL if the property
547 - * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
548 - * if the property data is smaller than sz_min or longer than sz_max.
549 + * it.
550 *
551 * dts entry of array should be like:
552 - * property = /bits/ 16 <0x5000 0x6000 0x7000>;
553 + * ``property = /bits/ 16 <0x5000 0x6000 0x7000>;``
554 + *
555 + * Return: The number of elements read on success, -EINVAL if the property
556 + * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
557 + * if the property data is smaller than sz_min or longer than sz_max.
558 *
559 * The out_values is modified only if a valid u16 value can be decoded.
560 */
561 @@ -291,7 +302,9 @@ EXPORT_SYMBOL_GPL(of_property_read_varia
562 * sz_min will be read.
563 *
564 * Search for a property in a device node and read 32-bit value(s) from
565 - * it. Returns number of elements read on success, -EINVAL if the property
566 + * it.
567 + *
568 + * Return: The number of elements read on success, -EINVAL if the property
569 * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
570 * if the property data is smaller than sz_min or longer than sz_max.
571 *
572 @@ -330,7 +343,9 @@ EXPORT_SYMBOL_GPL(of_property_read_varia
573 * @out_value: pointer to return value, modified only if return value is 0.
574 *
575 * Search for a property in a device node and read a 64-bit value from
576 - * it. Returns 0 on success, -EINVAL if the property does not exist,
577 + * it.
578 + *
579 + * Return: 0 on success, -EINVAL if the property does not exist,
580 * -ENODATA if property does not have a value, and -EOVERFLOW if the
581 * property data isn't large enough.
582 *
583 @@ -365,7 +380,9 @@ EXPORT_SYMBOL_GPL(of_property_read_u64);
584 * sz_min will be read.
585 *
586 * Search for a property in a device node and read 64-bit value(s) from
587 - * it. Returns number of elements read on success, -EINVAL if the property
588 + * it.
589 + *
590 + * Return: The number of elements read on success, -EINVAL if the property
591 * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
592 * if the property data is smaller than sz_min or longer than sz_max.
593 *
594 @@ -407,10 +424,11 @@ EXPORT_SYMBOL_GPL(of_property_read_varia
595 * return value is 0.
596 *
597 * Search for a property in a device tree node and retrieve a null
598 - * terminated string value (pointer to data, not a copy). Returns 0 on
599 - * success, -EINVAL if the property does not exist, -ENODATA if property
600 - * does not have a value, and -EILSEQ if the string is not null-terminated
601 - * within the length of the property data.
602 + * terminated string value (pointer to data, not a copy).
603 + *
604 + * Return: 0 on success, -EINVAL if the property does not exist, -ENODATA if
605 + * property does not have a value, and -EILSEQ if the string is not
606 + * null-terminated within the length of the property data.
607 *
608 * The out_string pointer is modified only if a valid string can be decoded.
609 */
610 @@ -774,7 +792,7 @@ EXPORT_SYMBOL(of_graph_get_remote_port_p
611 * @node: pointer to a local endpoint device_node
612 *
613 * Return: Remote port node associated with remote endpoint node linked
614 - * to @node. Use of_node_put() on it when done.
615 + * to @node. Use of_node_put() on it when done.
616 */
617 struct device_node *of_graph_get_remote_port(const struct device_node *node)
618 {
619 @@ -807,7 +825,7 @@ EXPORT_SYMBOL(of_graph_get_endpoint_coun
620 * @endpoint: identifier (value of reg property) of the endpoint node
621 *
622 * Return: Remote device node associated with remote endpoint node linked
623 - * to @node. Use of_node_put() on it when done.
624 + * to @node. Use of_node_put() on it when done.
625 */
626 struct device_node *of_graph_get_remote_node(const struct device_node *node,
627 u32 port, u32 endpoint)
628 --- a/include/linux/of.h
629 +++ b/include/linux/of.h
630 @@ -424,12 +424,14 @@ extern int of_detach_node(struct device_
631 * @sz: number of array elements to read
632 *
633 * Search for a property in a device node and read 8-bit value(s) from
634 - * it. Returns 0 on success, -EINVAL if the property does not exist,
635 - * -ENODATA if property does not have a value, and -EOVERFLOW if the
636 - * property data isn't large enough.
637 + * it.
638 *
639 * dts entry of array should be like:
640 - * property = /bits/ 8 <0x50 0x60 0x70>;
641 + * ``property = /bits/ 8 <0x50 0x60 0x70>;``
642 + *
643 + * Return: 0 on success, -EINVAL if the property does not exist,
644 + * -ENODATA if property does not have a value, and -EOVERFLOW if the
645 + * property data isn't large enough.
646 *
647 * The out_values is modified only if a valid u8 value can be decoded.
648 */
649 @@ -454,12 +456,14 @@ static inline int of_property_read_u8_ar
650 * @sz: number of array elements to read
651 *
652 * Search for a property in a device node and read 16-bit value(s) from
653 - * it. Returns 0 on success, -EINVAL if the property does not exist,
654 - * -ENODATA if property does not have a value, and -EOVERFLOW if the
655 - * property data isn't large enough.
656 + * it.
657 *
658 * dts entry of array should be like:
659 - * property = /bits/ 16 <0x5000 0x6000 0x7000>;
660 + * ``property = /bits/ 16 <0x5000 0x6000 0x7000>;``
661 + *
662 + * Return: 0 on success, -EINVAL if the property does not exist,
663 + * -ENODATA if property does not have a value, and -EOVERFLOW if the
664 + * property data isn't large enough.
665 *
666 * The out_values is modified only if a valid u16 value can be decoded.
667 */
668 @@ -485,7 +489,9 @@ static inline int of_property_read_u16_a
669 * @sz: number of array elements to read
670 *
671 * Search for a property in a device node and read 32-bit value(s) from
672 - * it. Returns 0 on success, -EINVAL if the property does not exist,
673 + * it.
674 + *
675 + * Return: 0 on success, -EINVAL if the property does not exist,
676 * -ENODATA if property does not have a value, and -EOVERFLOW if the
677 * property data isn't large enough.
678 *
679 @@ -513,7 +519,9 @@ static inline int of_property_read_u32_a
680 * @sz: number of array elements to read
681 *
682 * Search for a property in a device node and read 64-bit value(s) from
683 - * it. Returns 0 on success, -EINVAL if the property does not exist,
684 + * it.
685 + *
686 + * Return: 0 on success, -EINVAL if the property does not exist,
687 * -ENODATA if property does not have a value, and -EOVERFLOW if the
688 * property data isn't large enough.
689 *
690 @@ -1063,7 +1071,9 @@ static inline bool of_node_is_type(const
691 * @propname: name of the property to be searched.
692 *
693 * Search for a property in a device node and count the number of u8 elements
694 - * in it. Returns number of elements on sucess, -EINVAL if the property does
695 + * in it.
696 + *
697 + * Return: The number of elements on sucess, -EINVAL if the property does
698 * not exist or its length does not match a multiple of u8 and -ENODATA if the
699 * property does not have a value.
700 */
701 @@ -1080,7 +1090,9 @@ static inline int of_property_count_u8_e
702 * @propname: name of the property to be searched.
703 *
704 * Search for a property in a device node and count the number of u16 elements
705 - * in it. Returns number of elements on sucess, -EINVAL if the property does
706 + * in it.
707 + *
708 + * Return: The number of elements on sucess, -EINVAL if the property does
709 * not exist or its length does not match a multiple of u16 and -ENODATA if the
710 * property does not have a value.
711 */
712 @@ -1097,7 +1109,9 @@ static inline int of_property_count_u16_
713 * @propname: name of the property to be searched.
714 *
715 * Search for a property in a device node and count the number of u32 elements
716 - * in it. Returns number of elements on sucess, -EINVAL if the property does
717 + * in it.
718 + *
719 + * Return: The number of elements on sucess, -EINVAL if the property does
720 * not exist or its length does not match a multiple of u32 and -ENODATA if the
721 * property does not have a value.
722 */
723 @@ -1114,7 +1128,9 @@ static inline int of_property_count_u32_
724 * @propname: name of the property to be searched.
725 *
726 * Search for a property in a device node and count the number of u64 elements
727 - * in it. Returns number of elements on sucess, -EINVAL if the property does
728 + * in it.
729 + *
730 + * Return: The number of elements on sucess, -EINVAL if the property does
731 * not exist or its length does not match a multiple of u64 and -ENODATA if the
732 * property does not have a value.
733 */
734 @@ -1135,7 +1151,7 @@ static inline int of_property_count_u64_
735 * Search for a property in a device tree node and retrieve a list of
736 * terminated string values (pointer to data, not a copy) in that property.
737 *
738 - * If @out_strs is NULL, the number of strings in the property is returned.
739 + * Return: If @out_strs is NULL, the number of strings in the property is returned.
740 */
741 static inline int of_property_read_string_array(const struct device_node *np,
742 const char *propname, const char **out_strs,
743 @@ -1151,10 +1167,11 @@ static inline int of_property_read_strin
744 * @propname: name of the property to be searched.
745 *
746 * Search for a property in a device tree node and retrieve the number of null
747 - * terminated string contain in it. Returns the number of strings on
748 - * success, -EINVAL if the property does not exist, -ENODATA if property
749 - * does not have a value, and -EILSEQ if the string is not null-terminated
750 - * within the length of the property data.
751 + * terminated string contain in it.
752 + *
753 + * Return: The number of strings on success, -EINVAL if the property does not
754 + * exist, -ENODATA if property does not have a value, and -EILSEQ if the string
755 + * is not null-terminated within the length of the property data.
756 */
757 static inline int of_property_count_strings(const struct device_node *np,
758 const char *propname)
759 @@ -1174,7 +1191,8 @@ static inline int of_property_count_stri
760 * Search for a property in a device tree node and retrieve a null
761 * terminated string value (pointer to data, not a copy) in the list of strings
762 * contained in that property.
763 - * Returns 0 on success, -EINVAL if the property does not exist, -ENODATA if
764 + *
765 + * Return: 0 on success, -EINVAL if the property does not exist, -ENODATA if
766 * property does not have a value, and -EILSEQ if the string is not
767 * null-terminated within the length of the property data.
768 *
769 @@ -1194,7 +1212,8 @@ static inline int of_property_read_strin
770 * @propname: name of the property to be searched.
771 *
772 * Search for a property in a device node.
773 - * Returns true if the property exists false otherwise.
774 + *
775 + * Return: true if the property exists false otherwise.
776 */
777 static inline bool of_property_read_bool(const struct device_node *np,
778 const char *propname)
779 @@ -1440,7 +1459,7 @@ static inline int of_reconfig_get_state_
780 * of_device_is_system_power_controller - Tells if system-power-controller is found for device_node
781 * @np: Pointer to the given device_node
782 *
783 - * return true if present false otherwise
784 + * Return: true if present false otherwise
785 */
786 static inline bool of_device_is_system_power_controller(const struct device_node *np)
787 {