Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpiolib: Update the kernel documentation - add Return sections

$ scripts/kernel-doc -v -none -Wall drivers/gpio/gpiolib* 2>&1 | grep -w warning | wc -l
67

Fix these by adding Return sections. While at it, make sure all of
Return sections use the same style.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240828164449.2777666-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

Andy Shevchenko and committed by
Bartosz Golaszewski
94bd9ce1 1e3d42f5

+226 -58
+17 -5
drivers/gpio/gpiolib-acpi.c
··· 153 153 * @path: ACPI GPIO controller full path name, (e.g. "\\_SB.GPO1") 154 154 * @pin: ACPI GPIO pin number (0-based, controller-relative) 155 155 * 156 - * Return: GPIO descriptor to use with Linux generic GPIO API, or ERR_PTR 157 - * error value. Specifically returns %-EPROBE_DEFER if the referenced GPIO 156 + * Returns: 157 + * GPIO descriptor to use with Linux generic GPIO API. 158 + * If the GPIO cannot be translated or there is an error an ERR_PTR is 159 + * returned. 160 + * 161 + * Specifically returns %-EPROBE_DEFER if the referenced GPIO 158 162 * controller does not have GPIO chip registered at the moment. This is to 159 163 * support probe deferral. 160 164 */ ··· 228 224 * I/O resource or return False if not. 229 225 * @ares: Pointer to the ACPI resource to fetch 230 226 * @agpio: Pointer to a &struct acpi_resource_gpio to store the output pointer 227 + * 228 + * Returns: 229 + * %true if GpioIo resource is found, %false otherwise. 231 230 */ 232 231 bool acpi_gpio_get_io_resource(struct acpi_resource *ares, 233 232 struct acpi_resource_gpio **agpio) ··· 883 876 * that case @index is used to select the GPIO entry in the property value 884 877 * (in case of multiple). 885 878 * 886 - * If the GPIO cannot be translated or there is an error, an ERR_PTR is 879 + * Returns: 880 + * GPIO descriptor to use with Linux generic GPIO API. 881 + * If the GPIO cannot be translated or there is an error an ERR_PTR is 887 882 * returned. 888 883 * 889 884 * Note: if the GPIO resource has multiple entries in the pin list, this ··· 933 924 * resource with the relevant information from a data-only ACPI firmware node 934 925 * and uses that to obtain the GPIO descriptor to return. 935 926 * 927 + * Returns: 928 + * GPIO descriptor to use with Linux generic GPIO API. 936 929 * If the GPIO cannot be translated or there is an error an ERR_PTR is 937 930 * returned. 938 931 */ ··· 1053 1042 * The GPIO is considered wake capable if the GpioInt resource specifies 1054 1043 * SharedAndWake or ExclusiveAndWake. 1055 1044 * 1056 - * Return: Linux IRQ number (> %0) on success, negative errno on failure. 1045 + * Returns: 1046 + * Linux IRQ number (> 0) on success, negative errno on failure. 1057 1047 */ 1058 1048 int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *con_id, int index, 1059 1049 bool *wake_capable) ··· 1441 1429 * @fwnode: firmware node of the GPIO consumer 1442 1430 * @con_id: function within the GPIO consumer 1443 1431 * 1444 - * Return: 1432 + * Returns: 1445 1433 * The number of GPIOs associated with a firmware node / function or %-ENOENT, 1446 1434 * if no GPIO has been assigned to the requested function. 1447 1435 */
+6 -2
drivers/gpio/gpiolib-cdev.c
··· 2748 2748 * gpio_chrdev_open() - open the chardev for ioctl operations 2749 2749 * @inode: inode for this chardev 2750 2750 * @file: file struct for storing private data 2751 - * Returns 0 on success 2751 + * 2752 + * Returns: 2753 + * 0 on success, or negative errno on failure. 2752 2754 */ 2753 2755 static int gpio_chrdev_open(struct inode *inode, struct file *file) 2754 2756 { ··· 2816 2814 * gpio_chrdev_release() - close chardev after ioctl operations 2817 2815 * @inode: inode for this chardev 2818 2816 * @file: file struct for storing private data 2819 - * Returns 0 on success 2817 + * 2818 + * Returns: 2819 + * 0 on success, or negative errno on failure. 2820 2820 */ 2821 2821 static int gpio_chrdev_release(struct inode *inode, struct file *file) 2822 2822 {
+36 -2
drivers/gpio/gpiolib-devres.c
··· 52 52 * Managed gpiod_get(). GPIO descriptors returned from this function are 53 53 * automatically disposed on driver detach. See gpiod_get() for detailed 54 54 * information about behavior and return values. 55 + * 56 + * Returns: 57 + * The GPIO descriptor corresponding to the function @con_id of device 58 + * dev, %-ENOENT if no GPIO has been assigned to the requested function, or 59 + * another IS_ERR() code if an error occurred while trying to acquire the GPIO. 55 60 */ 56 61 struct gpio_desc *__must_check devm_gpiod_get(struct device *dev, 57 62 const char *con_id, ··· 75 70 * Managed gpiod_get_optional(). GPIO descriptors returned from this function 76 71 * are automatically disposed on driver detach. See gpiod_get_optional() for 77 72 * detailed information about behavior and return values. 73 + * 74 + * Returns: 75 + * The GPIO descriptor corresponding to the function @con_id of device 76 + * dev, NULL if no GPIO has been assigned to the requested function, or 77 + * another IS_ERR() code if an error occurred while trying to acquire the GPIO. 78 78 */ 79 79 struct gpio_desc *__must_check devm_gpiod_get_optional(struct device *dev, 80 80 const char *con_id, ··· 99 89 * Managed gpiod_get_index(). GPIO descriptors returned from this function are 100 90 * automatically disposed on driver detach. See gpiod_get_index() for detailed 101 91 * information about behavior and return values. 92 + * 93 + * Returns: 94 + * The GPIO descriptor corresponding to the function @con_id of device 95 + * dev, %-ENOENT if no GPIO has been assigned to the requested function, or 96 + * another IS_ERR() code if an error occurred while trying to acquire the GPIO. 102 97 */ 103 98 struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev, 104 99 const char *con_id, ··· 156 141 * GPIO descriptors returned from this function are automatically disposed on 157 142 * driver detach. 158 143 * 159 - * On successful request the GPIO pin is configured in accordance with 160 - * provided @flags. 144 + * Returns: 145 + * The GPIO descriptor corresponding to the function @con_id of device 146 + * dev, %-ENOENT if no GPIO has been assigned to the requested function, or 147 + * another IS_ERR() code if an error occurred while trying to acquire the GPIO. 161 148 */ 162 149 struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev, 163 150 struct fwnode_handle *fwnode, ··· 199 182 * function are automatically disposed on driver detach. See 200 183 * gpiod_get_index_optional() for detailed information about behavior and 201 184 * return values. 185 + * 186 + * Returns: 187 + * The GPIO descriptor corresponding to the function @con_id of device 188 + * dev, %NULL if no GPIO has been assigned to the requested function, or 189 + * another IS_ERR() code if an error occurred while trying to acquire the GPIO. 202 190 */ 203 191 struct gpio_desc *__must_check devm_gpiod_get_index_optional(struct device *dev, 204 192 const char *con_id, ··· 229 207 * Managed gpiod_get_array(). GPIO descriptors returned from this function are 230 208 * automatically disposed on driver detach. See gpiod_get_array() for detailed 231 209 * information about behavior and return values. 210 + * 211 + * Returns: 212 + * The GPIO descriptors corresponding to the function @con_id of device 213 + * dev, %-ENOENT if no GPIO has been assigned to the requested function, 214 + * or another IS_ERR() code if an error occurred while trying to acquire 215 + * the GPIOs. 232 216 */ 233 217 struct gpio_descs *__must_check devm_gpiod_get_array(struct device *dev, 234 218 const char *con_id, ··· 271 243 * function are automatically disposed on driver detach. 272 244 * See gpiod_get_array_optional() for detailed information about behavior and 273 245 * return values. 246 + * 247 + * Returns: 248 + * The GPIO descriptors corresponding to the function @con_id of device 249 + * dev, %NULL if no GPIO has been assigned to the requested function, 250 + * or another IS_ERR() code if an error occurred while trying to acquire 251 + * the GPIOs. 274 252 */ 275 253 struct gpio_descs *__must_check 276 254 devm_gpiod_get_array_optional(struct device *dev, const char *con_id,
+3
drivers/gpio/gpiolib-legacy.c
··· 22 22 * @label: a literal description string of this GPIO 23 23 * 24 24 * **DEPRECATED** This function is deprecated and must not be used in new code. 25 + * 26 + * Returns: 27 + * 0 on success, or negative errno on failure. 25 28 */ 26 29 int gpio_request_one(unsigned gpio, unsigned long flags, const char *label) 27 30 {
+34 -14
drivers/gpio/gpiolib-of.c
··· 46 46 * @propname: property name containing gpio specifier(s) 47 47 * 48 48 * 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. 53 50 * 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>; 59 62 * 60 63 * The above example defines four GPIOs, two of which are not specified. 61 64 * This function will return '4' ··· 80 77 * "gpios" for the chip select lines. If we detect this, we redirect 81 78 * the counting of "cs-gpios" to count "gpios" transparent to the 82 79 * driver. 80 + * 81 + * Returns: 82 + * Either number of GPIOs defined in the property, or 83 + * * %-EINVAL for an incorrectly formed "gpios" property, or 84 + * * %-ENOENT for a missing "gpios" property. 83 85 */ 84 86 static int of_gpio_spi_cs_get_count(const struct device_node *np, 85 87 const char *con_id) ··· 381 373 * @index: index of the GPIO 382 374 * @flags: a flags pointer to fill in 383 375 * 384 - * Returns GPIO descriptor to use with Linux GPIO API, or one of the errno 376 + * Returns: 377 + * GPIO descriptor to use with Linux GPIO API, or one of the errno 385 378 * value on the error condition. If @flags is not NULL the function also fills 386 379 * in flags for the GPIO. 387 380 */ ··· 434 425 * 435 426 * **DEPRECATED** This function is deprecated and must not be used in new code. 436 427 * 437 - * Returns GPIO number to use with Linux generic GPIO API, or one of the errno 428 + * Returns: 429 + * GPIO number to use with Linux generic GPIO API, or one of the errno 438 430 * value on the error condition. 439 431 */ 440 432 int of_get_named_gpio(const struct device_node *np, const char *propname, ··· 721 711 * of_find_gpio() or of_parse_own_gpio() 722 712 * @dflags: gpiod_flags - optional GPIO initialization flags 723 713 * 724 - * Returns GPIO descriptor to use with Linux GPIO API, or one of the errno 714 + * Returns: 715 + * GPIO descriptor to use with Linux GPIO API, or one of the errno 725 716 * value on the error condition. 726 717 */ 727 718 static struct gpio_desc *of_parse_own_gpio(struct device_node *np, ··· 790 779 * @chip: gpio chip to act on 791 780 * @hog: device node describing the hogs 792 781 * 793 - * Returns error if it fails otherwise 0 on success. 782 + * Returns: 783 + * 0 on success, or negative errno on failure. 794 784 */ 795 785 static int of_gpiochip_add_hog(struct gpio_chip *chip, struct device_node *hog) 796 786 { ··· 825 813 * 826 814 * This is only used by of_gpiochip_add to request/set GPIO initial 827 815 * configuration. 828 - * It returns error if it fails otherwise 0 on success. 816 + * 817 + * Returns: 818 + * 0 on success, or negative errno on failure. 829 819 */ 830 820 static int of_gpiochip_scan_gpios(struct gpio_chip *chip) 831 821 { ··· 937 923 * This is simple translation function, suitable for the most 1:1 mapped 938 924 * GPIO chips. This function performs only one sanity check: whether GPIO 939 925 * is less than ngpios (that is specified in the gpio_chip). 926 + * 927 + * Returns: 928 + * GPIO number (>= 0) on success, negative errno on failure. 940 929 */ 941 930 static int of_gpio_simple_xlate(struct gpio_chip *gc, 942 931 const struct of_phandle_args *gpiospec, ··· 989 972 * If succeeded, this function will map bank's memory and will 990 973 * do all necessary work for you. Then you'll able to use .regs 991 974 * to manage GPIOs from the callbacks. 975 + * 976 + * Returns: 977 + * 0 on success, or negative errno on failure. 992 978 */ 993 979 int of_mm_gpiochip_add_data(struct device_node *np, 994 980 struct of_mm_gpio_chip *mm_gc,
+1 -1
drivers/gpio/gpiolib-swnode.c
··· 106 106 * system-global GPIOs 107 107 * @con_id: function within the GPIO consumer 108 108 * 109 - * Return: 109 + * Returns: 110 110 * The number of GPIOs associated with a device / function or %-ENOENT, 111 111 * if no GPIO has been assigned to the requested function. 112 112 */
+4 -2
drivers/gpio/gpiolib-sysfs.c
··· 568 568 * will see "direction" sysfs attribute which may be used to change 569 569 * the gpio's direction. A "value" attribute will always be provided. 570 570 * 571 - * Returns zero on success, else an error. 571 + * Returns: 572 + * 0 on success, or negative errno on failure. 572 573 */ 573 574 int gpiod_export(struct gpio_desc *desc, bool direction_may_change) 574 575 { ··· 668 667 * Set up a symlink from /sys/.../dev/name to /sys/class/gpio/gpioN 669 668 * node. Caller is responsible for unlinking. 670 669 * 671 - * Returns zero on success, else an error. 670 + * Returns: 671 + * 0 on success, or negative errno on failure. 672 672 */ 673 673 int gpiod_export_link(struct device *dev, const char *name, 674 674 struct gpio_desc *desc)
+125 -32
drivers/gpio/gpiolib.c
··· 230 230 * This function is unsafe and should not be used. Using the chip address 231 231 * without taking the SRCU read lock may result in dereferencing a dangling 232 232 * pointer. 233 + * 234 + * Returns: 235 + * Address of the GPIO chip backing this device. 233 236 */ 234 237 struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc) 235 238 { ··· 345 342 * gpiod_get_direction - return the current direction of a GPIO 346 343 * @desc: GPIO to get the direction of 347 344 * 348 - * Returns 0 for output, 1 for input, or an error code in case of error. 345 + * Returns: 346 + * 0 for output, 1 for input, or an error code in case of error. 349 347 * 350 348 * This function may sleep if gpiod_cansleep() is true. 351 349 */ ··· 403 399 * Add a new chip to the global chips list, keeping the list of chips sorted 404 400 * by range(means [base, base + ngpio - 1]) order. 405 401 * 406 - * Return -EBUSY if the new chip overlaps with some other chip's integer 407 - * space. 402 + * Returns: 403 + * -EBUSY if the new chip overlaps with some other chip's integer space. 408 404 */ 409 405 static int gpiodev_add_to_list_unlocked(struct gpio_device *gdev) 410 406 { ··· 1520 1516 * This function is a wrapper that calls gpiochip_lock_as_irq() and is to be 1521 1517 * used as the activate function for the &struct irq_domain_ops. The host_data 1522 1518 * for the IRQ domain must be the &struct gpio_chip. 1519 + * 1520 + * Returns: 1521 + * 0 on success, or negative errno on failure. 1523 1522 */ 1524 1523 static int gpiochip_irq_domain_activate(struct irq_domain *domain, 1525 1524 struct irq_data *data, bool reserve) ··· 1667 1660 * This function will set up the mapping for a certain IRQ line on a 1668 1661 * gpiochip by assigning the gpiochip as chip data, and using the irqchip 1669 1662 * stored inside the gpiochip. 1663 + * 1664 + * Returns: 1665 + * 0 on success, or negative errno on failure. 1670 1666 */ 1671 1667 static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq, 1672 1668 irq_hw_number_t hwirq) ··· 1904 1894 * @gc: the GPIO chip to add the IRQ chip to 1905 1895 * @lock_key: lockdep class for IRQ lock 1906 1896 * @request_key: lockdep class for IRQ request 1897 + * 1898 + * Returns: 1899 + * 0 on success, or a negative errno on failure. 1907 1900 */ 1908 1901 static int gpiochip_add_irqchip(struct gpio_chip *gc, 1909 1902 struct lock_class_key *lock_key, ··· 2042 2029 * @domain: the irqdomain to add to the gpiochip 2043 2030 * 2044 2031 * This function adds an IRQ domain to the gpiochip. 2032 + * 2033 + * Returns: 2034 + * 0 on success, or negative errno on failure. 2045 2035 */ 2046 2036 int gpiochip_irqchip_add_domain(struct gpio_chip *gc, 2047 2037 struct irq_domain *domain) ··· 2081 2065 * gpiochip_generic_request() - request the gpio function for a pin 2082 2066 * @gc: the gpiochip owning the GPIO 2083 2067 * @offset: the offset of the GPIO to request for GPIO function 2068 + * 2069 + * Returns: 2070 + * 0 on success, or negative errno on failure. 2084 2071 */ 2085 2072 int gpiochip_generic_request(struct gpio_chip *gc, unsigned int offset) 2086 2073 { ··· 2117 2098 * @gc: the gpiochip owning the GPIO 2118 2099 * @offset: the offset of the GPIO to apply the configuration 2119 2100 * @config: the configuration to be applied 2101 + * 2102 + * Returns: 2103 + * 0 on success, or negative errno on failure. 2120 2104 */ 2121 2105 int gpiochip_generic_config(struct gpio_chip *gc, unsigned int offset, 2122 2106 unsigned long config) ··· 2146 2124 * pinctrl driver is DEPRECATED. Please see Section 2.1 of 2147 2125 * Documentation/devicetree/bindings/gpio/gpio.txt on how to 2148 2126 * bind pinctrl and gpio drivers via the "gpio-ranges" property. 2127 + * 2128 + * Returns: 2129 + * 0 on success, or negative errno on failure. 2149 2130 */ 2150 2131 int gpiochip_add_pingroup_range(struct gpio_chip *gc, 2151 2132 struct pinctrl_dev *pctldev, ··· 2200 2175 * @npins: the number of pins from the offset of each pin space (GPIO and 2201 2176 * pin controller) to accumulate in this range 2202 2177 * 2203 - * Returns: 2204 - * 0 on success, or a negative error-code on failure. 2205 - * 2206 2178 * Calling this function directly from a DeviceTree-supported 2207 2179 * pinctrl driver is DEPRECATED. Please see Section 2.1 of 2208 2180 * Documentation/devicetree/bindings/gpio/gpio.txt on how to 2209 2181 * bind pinctrl and gpio drivers via the "gpio-ranges" property. 2182 + * 2183 + * Returns: 2184 + * 0 on success, or a negative errno on failure. 2210 2185 */ 2211 2186 int gpiochip_add_pin_range(struct gpio_chip *gc, const char *pinctl_name, 2212 2187 unsigned int gpio_offset, unsigned int pin_offset, ··· 2610 2585 * The function calls the certain GPIO driver to set debounce timeout 2611 2586 * in the hardware. 2612 2587 * 2613 - * Returns 0 on success, or negative error code otherwise. 2588 + * Returns: 2589 + * 0 on success, or negative errno on failure. 2614 2590 */ 2615 2591 int gpio_set_debounce_timeout(struct gpio_desc *desc, unsigned int debounce) 2616 2592 { ··· 2627 2601 * Set the direction of the passed GPIO to input, such as gpiod_get_value() can 2628 2602 * be called safely on it. 2629 2603 * 2630 - * Return 0 in case of success, else an error code. 2604 + * Returns: 2605 + * 0 on success, or negative errno on failure. 2631 2606 */ 2632 2607 int gpiod_direction_input(struct gpio_desc *desc) 2633 2608 { ··· 2735 2708 * be called safely on it. The initial value of the output must be specified 2736 2709 * as raw value on the physical line without regard for the ACTIVE_LOW status. 2737 2710 * 2738 - * Return 0 in case of success, else an error code. 2711 + * Returns: 2712 + * 0 on success, or negative errno on failure. 2739 2713 */ 2740 2714 int gpiod_direction_output_raw(struct gpio_desc *desc, int value) 2741 2715 { ··· 2755 2727 * as the logical value of the GPIO, i.e. taking its ACTIVE_LOW status into 2756 2728 * account. 2757 2729 * 2758 - * Return 0 in case of success, else an error code. 2730 + * Returns: 2731 + * 0 on success, or negative errno on failure. 2759 2732 */ 2760 2733 int gpiod_direction_output(struct gpio_desc *desc, int value) 2761 2734 { ··· 2829 2800 * @desc: GPIO to enable. 2830 2801 * @flags: Flags related to GPIO edge. 2831 2802 * 2832 - * Return 0 in case of success, else negative error code. 2803 + * Returns: 2804 + * 0 on success, or negative errno on failure. 2833 2805 */ 2834 2806 int gpiod_enable_hw_timestamp_ns(struct gpio_desc *desc, unsigned long flags) 2835 2807 { ··· 2862 2832 * @desc: GPIO to disable. 2863 2833 * @flags: Flags related to GPIO edge, same value as used during enable call. 2864 2834 * 2865 - * Return 0 in case of success, else negative error code. 2835 + * Returns: 2836 + * 0 on success, or negative errno on failure. 2866 2837 */ 2867 2838 int gpiod_disable_hw_timestamp_ns(struct gpio_desc *desc, unsigned long flags) 2868 2839 { ··· 2955 2924 * gpiod_is_active_low - test whether a GPIO is active-low or not 2956 2925 * @desc: the gpio descriptor to test 2957 2926 * 2958 - * Returns 1 if the GPIO is active-low, 0 otherwise. 2927 + * Returns: 2928 + * 1 if the GPIO is active-low, 0 otherwise. 2959 2929 */ 2960 2930 int gpiod_is_active_low(const struct gpio_desc *desc) 2961 2931 { ··· 3171 3139 * gpiod_get_raw_value() - return a gpio's raw value 3172 3140 * @desc: gpio whose value will be returned 3173 3141 * 3174 - * Return the GPIO's raw value, i.e. the value of the physical line disregarding 3142 + * Returns: 3143 + * The GPIO's raw value, i.e. the value of the physical line disregarding 3175 3144 * its ACTIVE_LOW status, or negative errno on failure. 3176 3145 * 3177 3146 * This function can be called from contexts where we cannot sleep, and will ··· 3191 3158 * gpiod_get_value() - return a gpio's value 3192 3159 * @desc: gpio whose value will be returned 3193 3160 * 3194 - * Return the GPIO's logical value, i.e. taking the ACTIVE_LOW status into 3161 + * Returns: 3162 + * The GPIO's logical value, i.e. taking the ACTIVE_LOW status into 3195 3163 * account, or negative errno on failure. 3196 3164 * 3197 3165 * This function can be called from contexts where we cannot sleep, and will ··· 3225 3191 * @value_bitmap: bitmap to store the read values 3226 3192 * 3227 3193 * Read the raw values of the GPIOs, i.e. the values of the physical lines 3228 - * without regard for their ACTIVE_LOW status. Return 0 in case of success, 3229 - * else an error code. 3194 + * without regard for their ACTIVE_LOW status. 3230 3195 * 3231 3196 * This function can be called from contexts where we cannot sleep, 3232 3197 * and it will complain if the GPIO chip functions potentially sleep. 3198 + * 3199 + * Returns: 3200 + * 0 on success, or negative errno on failure. 3233 3201 */ 3234 3202 int gpiod_get_raw_array_value(unsigned int array_size, 3235 3203 struct gpio_desc **desc_array, ··· 3254 3218 * @value_bitmap: bitmap to store the read values 3255 3219 * 3256 3220 * Read the logical values of the GPIOs, i.e. taking their ACTIVE_LOW status 3257 - * into account. Return 0 in case of success, else an error code. 3221 + * into account. 3258 3222 * 3259 3223 * This function can be called from contexts where we cannot sleep, 3260 3224 * and it will complain if the GPIO chip functions potentially sleep. 3225 + * 3226 + * Returns: 3227 + * 0 on success, or negative errno on failure. 3261 3228 */ 3262 3229 int gpiod_get_array_value(unsigned int array_size, 3263 3230 struct gpio_desc **desc_array, ··· 3548 3509 * 3549 3510 * This function can be called from contexts where we cannot sleep, and will 3550 3511 * complain if the GPIO chip functions potentially sleep. 3512 + * 3513 + * Returns: 3514 + * 0 on success, or negative errno on failure. 3551 3515 */ 3552 3516 int gpiod_set_raw_array_value(unsigned int array_size, 3553 3517 struct gpio_desc **desc_array, ··· 3576 3534 * 3577 3535 * This function can be called from contexts where we cannot sleep, and will 3578 3536 * complain if the GPIO chip functions potentially sleep. 3537 + * 3538 + * Returns: 3539 + * 0 on success, or negative errno on failure. 3579 3540 */ 3580 3541 int gpiod_set_array_value(unsigned int array_size, 3581 3542 struct gpio_desc **desc_array, ··· 3597 3552 * gpiod_cansleep() - report whether gpio value access may sleep 3598 3553 * @desc: gpio to check 3599 3554 * 3555 + * Returns: 3556 + * 0 for non-sleepable, 1 for sleepable, or an error code in case of error. 3600 3557 */ 3601 3558 int gpiod_cansleep(const struct gpio_desc *desc) 3602 3559 { ··· 3611 3564 * gpiod_set_consumer_name() - set the consumer name for the descriptor 3612 3565 * @desc: gpio to set the consumer name on 3613 3566 * @name: the new consumer name 3567 + * 3568 + * Returns: 3569 + * 0 on success, or negative errno on failure. 3614 3570 */ 3615 3571 int gpiod_set_consumer_name(struct gpio_desc *desc, const char *name) 3616 3572 { ··· 3627 3577 * gpiod_to_irq() - return the IRQ corresponding to a GPIO 3628 3578 * @desc: gpio whose IRQ will be returned (already requested) 3629 3579 * 3630 - * Return the IRQ corresponding to the passed GPIO, or an error code in case of 3631 - * error. 3580 + * Returns: 3581 + * The IRQ corresponding to the passed GPIO, or an error code in case of error. 3632 3582 */ 3633 3583 int gpiod_to_irq(const struct gpio_desc *desc) 3634 3584 { ··· 3682 3632 * 3683 3633 * This is used directly by GPIO drivers that want to lock down 3684 3634 * a certain GPIO line to be used for IRQs. 3635 + * 3636 + * Returns: 3637 + * 0 on success, or negative errno on failure. 3685 3638 */ 3686 3639 int gpiochip_lock_as_irq(struct gpio_chip *gc, unsigned int offset) 3687 3640 { ··· 3836 3783 * gpiod_get_raw_value_cansleep() - return a gpio's raw value 3837 3784 * @desc: gpio whose value will be returned 3838 3785 * 3839 - * Return the GPIO's raw value, i.e. the value of the physical line disregarding 3786 + * Returns: 3787 + * The GPIO's raw value, i.e. the value of the physical line disregarding 3840 3788 * its ACTIVE_LOW status, or negative errno on failure. 3841 3789 * 3842 3790 * This function is to be called from contexts that can sleep. ··· 3854 3800 * gpiod_get_value_cansleep() - return a gpio's value 3855 3801 * @desc: gpio whose value will be returned 3856 3802 * 3857 - * Return the GPIO's logical value, i.e. taking the ACTIVE_LOW status into 3803 + * Returns: 3804 + * The GPIO's logical value, i.e. taking the ACTIVE_LOW status into 3858 3805 * account, or negative errno on failure. 3859 3806 * 3860 3807 * This function is to be called from contexts that can sleep. ··· 3885 3830 * @value_bitmap: bitmap to store the read values 3886 3831 * 3887 3832 * Read the raw values of the GPIOs, i.e. the values of the physical lines 3888 - * without regard for their ACTIVE_LOW status. Return 0 in case of success, 3889 - * else an error code. 3833 + * without regard for their ACTIVE_LOW status. 3890 3834 * 3891 3835 * This function is to be called from contexts that can sleep. 3836 + * 3837 + * Returns: 3838 + * 0 on success, or negative errno on failure. 3892 3839 */ 3893 3840 int gpiod_get_raw_array_value_cansleep(unsigned int array_size, 3894 3841 struct gpio_desc **desc_array, ··· 3914 3857 * @value_bitmap: bitmap to store the read values 3915 3858 * 3916 3859 * Read the logical values of the GPIOs, i.e. taking their ACTIVE_LOW status 3917 - * into account. Return 0 in case of success, else an error code. 3860 + * into account. 3918 3861 * 3919 3862 * This function is to be called from contexts that can sleep. 3863 + * 3864 + * Returns: 3865 + * 0 on success, or negative errno on failure. 3920 3866 */ 3921 3867 int gpiod_get_array_value_cansleep(unsigned int array_size, 3922 3868 struct gpio_desc **desc_array, ··· 3982 3922 * without regard for their ACTIVE_LOW status. 3983 3923 * 3984 3924 * This function is to be called from contexts that can sleep. 3925 + * 3926 + * Returns: 3927 + * 0 on success, or negative errno on failure. 3985 3928 */ 3986 3929 int gpiod_set_raw_array_value_cansleep(unsigned int array_size, 3987 3930 struct gpio_desc **desc_array, ··· 4027 3964 * into account. 4028 3965 * 4029 3966 * This function is to be called from contexts that can sleep. 3967 + * 3968 + * Returns: 3969 + * 0 on success, or negative errno on failure. 4030 3970 */ 4031 3971 int gpiod_set_array_value_cansleep(unsigned int array_size, 4032 3972 struct gpio_desc **desc_array, ··· 4363 4297 4364 4298 /** 4365 4299 * gpiod_count - return the number of GPIOs associated with a device / function 4366 - * or -ENOENT if no GPIO has been assigned to the requested function 4367 4300 * @dev: GPIO consumer, can be NULL for system-global GPIOs 4368 4301 * @con_id: function within the GPIO consumer 4302 + * 4303 + * Returns: 4304 + * The number of GPIOs associated with a device / function or -ENOENT if no 4305 + * GPIO has been assigned to the requested function. 4369 4306 */ 4370 4307 int gpiod_count(struct device *dev, const char *con_id) 4371 4308 { ··· 4395 4326 * @con_id: function within the GPIO consumer 4396 4327 * @flags: optional GPIO initialization flags 4397 4328 * 4398 - * Return the GPIO descriptor corresponding to the function con_id of device 4329 + * Returns: 4330 + * The GPIO descriptor corresponding to the function @con_id of device 4399 4331 * dev, -ENOENT if no GPIO has been assigned to the requested function, or 4400 4332 * another IS_ERR() code if an error occurred while trying to acquire the GPIO. 4401 4333 */ ··· 4416 4346 * This is equivalent to gpiod_get(), except that when no GPIO was assigned to 4417 4347 * the requested function it will return NULL. This is convenient for drivers 4418 4348 * that need to handle optional GPIOs. 4349 + * 4350 + * Returns: 4351 + * The GPIO descriptor corresponding to the function @con_id of device 4352 + * dev, NULL if no GPIO has been assigned to the requested function, or 4353 + * another IS_ERR() code if an error occurred while trying to acquire the GPIO. 4419 4354 */ 4420 4355 struct gpio_desc *__must_check gpiod_get_optional(struct device *dev, 4421 4356 const char *con_id, ··· 4439 4364 * of_find_gpio() or of_get_gpio_hog() 4440 4365 * @dflags: gpiod_flags - optional GPIO initialization flags 4441 4366 * 4442 - * Return 0 on success, -ENOENT if no GPIO has been assigned to the 4367 + * Returns: 4368 + * 0 on success, -ENOENT if no GPIO has been assigned to the 4443 4369 * requested function and/or index, or another IS_ERR() code if an error 4444 4370 * occurred while trying to acquire the GPIO. 4445 4371 */ ··· 4515 4439 * This variant of gpiod_get() allows to access GPIOs other than the first 4516 4440 * defined one for functions that define several GPIOs. 4517 4441 * 4518 - * Return a valid GPIO descriptor, -ENOENT if no GPIO has been assigned to the 4442 + * Returns: 4443 + * A valid GPIO descriptor, -ENOENT if no GPIO has been assigned to the 4519 4444 * requested function and/or index, or another IS_ERR() code if an error 4520 4445 * occurred while trying to acquire the GPIO. 4521 4446 */ ··· 4544 4467 * This is equivalent to gpiod_get_index(), except that when no GPIO with the 4545 4468 * specified index was assigned to the requested function it will return NULL. 4546 4469 * This is convenient for drivers that need to handle optional GPIOs. 4470 + * 4471 + * Returns: 4472 + * A valid GPIO descriptor, NULL if no GPIO has been assigned to the 4473 + * requested function and/or index, or another IS_ERR() code if an error 4474 + * occurred while trying to acquire the GPIO. 4547 4475 */ 4548 4476 struct gpio_desc *__must_check gpiod_get_index_optional(struct device *dev, 4549 4477 const char *con_id, ··· 4572 4490 * @lflags: bitmask of gpio_lookup_flags GPIO_* values - returned from 4573 4491 * of_find_gpio() or of_get_gpio_hog() 4574 4492 * @dflags: gpiod_flags - optional GPIO initialization flags 4493 + * 4494 + * Returns: 4495 + * 0 on success, or negative errno on failure. 4575 4496 */ 4576 4497 int gpiod_hog(struct gpio_desc *desc, const char *name, 4577 4498 unsigned long lflags, enum gpiod_flags dflags) ··· 4631 4546 * 4632 4547 * This function acquires all the GPIOs defined under a given function. 4633 4548 * 4634 - * Return a struct gpio_descs containing an array of descriptors, -ENOENT if 4635 - * no GPIO has been assigned to the requested function, or another IS_ERR() 4636 - * code if an error occurred while trying to acquire the GPIOs. 4549 + * Returns: 4550 + * The GPIO descriptors corresponding to the function @con_id of device 4551 + * dev, -ENOENT if no GPIO has been assigned to the requested function, 4552 + * or another IS_ERR() code if an error occurred while trying to acquire 4553 + * the GPIOs. 4637 4554 */ 4638 4555 struct gpio_descs *__must_check gpiod_get_array(struct device *dev, 4639 4556 const char *con_id, ··· 4761 4674 * 4762 4675 * This is equivalent to gpiod_get_array(), except that when no GPIO was 4763 4676 * assigned to the requested function it will return NULL. 4677 + * 4678 + * Returns: 4679 + * The GPIO descriptors corresponding to the function @con_id of device 4680 + * dev, NULL if no GPIO has been assigned to the requested function, 4681 + * or another IS_ERR() code if an error occurred while trying to acquire 4682 + * the GPIOs. 4764 4683 */ 4765 4684 struct gpio_descs *__must_check gpiod_get_array_optional(struct device *dev, 4766 4685 const char *con_id,