@@ -46,16 +46,19 @@ enum of_gpio_flags {
4646 * @propname: property name containing gpio specifier(s)
4747 *
4848 * The function returns the count of GPIOs specified for a node.
49- * Note that the empty GPIO specifiers count too. Returns either
50- * Number of gpios defined in property,
51- * -EINVAL for an incorrectly formed gpios property, or
52- * -ENOENT for a missing gpios property
49+ * NOTE: The empty GPIO specifiers count too.
5350 *
54- * Example:
55- * gpios = <0
56- * &gpio1 1 2
57- * 0
58- * &gpio2 3 4>;
51+ * Returns:
52+ * Either number of GPIOs defined in the property, or
53+ * * %-EINVAL for an incorrectly formed "gpios" property, or
54+ * * %-ENOENT for a missing "gpios" property.
55+ *
56+ * Example::
57+ *
58+ * gpios = <0
59+ * &gpio1 1 2
60+ * 0
61+ * &gpio2 3 4>;
5962 *
6063 * The above example defines four GPIOs, two of which are not specified.
6164 * This function will return '4'
@@ -77,6 +80,11 @@ static int of_gpio_named_count(const struct device_node *np,
7780 * "gpios" for the chip select lines. If we detect this, we redirect
7881 * the counting of "cs-gpios" to count "gpios" transparent to the
7982 * driver.
83+ *
84+ * Returns:
85+ * Either number of GPIOs defined in the property, or
86+ * * %-EINVAL for an incorrectly formed "gpios" property, or
87+ * * %-ENOENT for a missing "gpios" property.
8088 */
8189static int of_gpio_spi_cs_get_count (const struct device_node * np ,
8290 const char * con_id )
@@ -373,7 +381,8 @@ static void of_gpio_flags_quirks(const struct device_node *np,
373381 * @index: index of the GPIO
374382 * @flags: a flags pointer to fill in
375383 *
376- * Returns GPIO descriptor to use with Linux GPIO API, or one of the errno
384+ * Returns:
385+ * GPIO descriptor to use with Linux GPIO API, or one of the errno
377386 * value on the error condition. If @flags is not NULL the function also fills
378387 * in flags for the GPIO.
379388 */
@@ -425,7 +434,8 @@ static struct gpio_desc *of_get_named_gpiod_flags(const struct device_node *np,
425434 *
426435 * **DEPRECATED** This function is deprecated and must not be used in new code.
427436 *
428- * Returns GPIO number to use with Linux generic GPIO API, or one of the errno
437+ * Returns:
438+ * GPIO number to use with Linux generic GPIO API, or one of the errno
429439 * value on the error condition.
430440 */
431441int of_get_named_gpio (const struct device_node * np , const char * propname ,
@@ -711,7 +721,8 @@ struct gpio_desc *of_find_gpio(struct device_node *np, const char *con_id,
711721 * of_find_gpio() or of_parse_own_gpio()
712722 * @dflags: gpiod_flags - optional GPIO initialization flags
713723 *
714- * Returns GPIO descriptor to use with Linux GPIO API, or one of the errno
724+ * Returns:
725+ * GPIO descriptor to use with Linux GPIO API, or one of the errno
715726 * value on the error condition.
716727 */
717728static struct gpio_desc * of_parse_own_gpio (struct device_node * np ,
@@ -779,7 +790,8 @@ static struct gpio_desc *of_parse_own_gpio(struct device_node *np,
779790 * @chip: gpio chip to act on
780791 * @hog: device node describing the hogs
781792 *
782- * Returns error if it fails otherwise 0 on success.
793+ * Returns:
794+ * 0 on success, or negative errno on failure.
783795 */
784796static int of_gpiochip_add_hog (struct gpio_chip * chip , struct device_node * hog )
785797{
@@ -813,7 +825,9 @@ static int of_gpiochip_add_hog(struct gpio_chip *chip, struct device_node *hog)
813825 *
814826 * This is only used by of_gpiochip_add to request/set GPIO initial
815827 * configuration.
816- * It returns error if it fails otherwise 0 on success.
828+ *
829+ * Returns:
830+ * 0 on success, or negative errno on failure.
817831 */
818832static int of_gpiochip_scan_gpios (struct gpio_chip * chip )
819833{
@@ -923,6 +937,9 @@ struct notifier_block gpio_of_notifier = {
923937 * This is simple translation function, suitable for the most 1:1 mapped
924938 * GPIO chips. This function performs only one sanity check: whether GPIO
925939 * is less than ngpios (that is specified in the gpio_chip).
940+ *
941+ * Returns:
942+ * GPIO number (>= 0) on success, negative errno on failure.
926943 */
927944static int of_gpio_simple_xlate (struct gpio_chip * gc ,
928945 const struct of_phandle_args * gpiospec ,
@@ -972,6 +989,9 @@ static int of_gpio_simple_xlate(struct gpio_chip *gc,
972989 * If succeeded, this function will map bank's memory and will
973990 * do all necessary work for you. Then you'll able to use .regs
974991 * to manage GPIOs from the callbacks.
992+ *
993+ * Returns:
994+ * 0 on success, or negative errno on failure.
975995 */
976996int of_mm_gpiochip_add_data (struct device_node * np ,
977997 struct of_mm_gpio_chip * mm_gc ,
0 commit comments