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

Configure Feed

Select the types of activity you want to include in your feed.

iio: core: Fix issues and style of the comments

The `scripts/kernel-doc -v -none -Wall` reports several issues
with the kernel doc in IIO core C file. Update the comments
accordingly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/r/20230724110204.46285-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
65659a8d 5a0821e0

+37 -20
+37 -20
drivers/iio/industrialio-core.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 - /* The industrial I/O core 2 + /* 3 + * The industrial I/O core 3 4 * 4 5 * Copyright (c) 2008 Jonathan Cameron 5 6 * ··· 184 183 * @indio_dev: Device structure whose ID is being queried 185 184 * 186 185 * The IIO device ID is a unique index used for example for the naming 187 - * of the character device /dev/iio\:device[ID] 186 + * of the character device /dev/iio\:device[ID]. 187 + * 188 + * Returns: Unique ID for the device. 188 189 */ 189 190 int iio_device_id(struct iio_dev *indio_dev) 190 191 { ··· 199 196 /** 200 197 * iio_buffer_enabled() - helper function to test if the buffer is enabled 201 198 * @indio_dev: IIO device structure for device 199 + * 200 + * Returns: True, if the buffer is enabled. 202 201 */ 203 202 bool iio_buffer_enabled(struct iio_dev *indio_dev) 204 203 { ··· 230 225 * iio_find_channel_from_si() - get channel from its scan index 231 226 * @indio_dev: device 232 227 * @si: scan index to match 228 + * 229 + * Returns: 230 + * Constant pointer to iio_chan_spec, if scan index matches, NULL on failure. 233 231 */ 234 232 const struct iio_chan_spec 235 233 *iio_find_channel_from_si(struct iio_dev *indio_dev, int si) ··· 257 249 /** 258 250 * iio_device_set_clock() - Set current timestamping clock for the device 259 251 * @indio_dev: IIO device structure containing the device 260 - * @clock_id: timestamping clock posix identifier to set. 252 + * @clock_id: timestamping clock POSIX identifier to set. 253 + * 254 + * Returns: 0 on success, or a negative error code. 261 255 */ 262 256 int iio_device_set_clock(struct iio_dev *indio_dev, clockid_t clock_id) 263 257 { ··· 285 275 /** 286 276 * iio_device_get_clock() - Retrieve current timestamping clock for the device 287 277 * @indio_dev: IIO device structure containing the device 278 + * 279 + * Returns: Clock ID of the current timestamping clock for the device. 288 280 */ 289 281 clockid_t iio_device_get_clock(const struct iio_dev *indio_dev) 290 282 { ··· 299 287 /** 300 288 * iio_get_time_ns() - utility function to get a time stamp for events etc 301 289 * @indio_dev: device 290 + * 291 + * Returns: Timestamp of the event in nanoseconds. 302 292 */ 303 293 s64 iio_get_time_ns(const struct iio_dev *indio_dev) 304 294 { ··· 607 593 * If device is assigned no mounting matrix property, a default 3x3 identity 608 594 * matrix will be filled in. 609 595 * 610 - * Return: 0 if success, or a negative error code on failure. 596 + * Returns: 0 if success, or a negative error code on failure. 611 597 */ 612 598 int iio_read_mount_matrix(struct device *dev, struct iio_mount_matrix *matrix) 613 599 { ··· 705 691 * @vals: Pointer to the values, exact meaning depends on the 706 692 * type parameter. 707 693 * 708 - * Return: 0 by default, a negative number on failure or the 709 - * total number of characters written for a type that belongs 710 - * to the IIO_VAL_* constant. 694 + * Returns: 695 + * 0 by default, a negative number on failure or the total number of characters 696 + * written for a type that belongs to the IIO_VAL_* constant. 711 697 */ 712 698 ssize_t iio_format_value(char *buf, unsigned int type, int size, int *vals) 713 699 { ··· 860 846 * @fract: The fractional part of the number 861 847 * @scale_db: True if this should parse as dB 862 848 * 863 - * Returns 0 on success, or a negative error code if the string could not be 864 - * parsed. 849 + * Returns: 850 + * 0 on success, or a negative error code if the string could not be parsed. 865 851 */ 866 852 static int __iio_str_to_fixpoint(const char *str, int fract_mult, 867 853 int *integer, int *fract, bool scale_db) ··· 930 916 * @integer: The integer part of the number 931 917 * @fract: The fractional part of the number 932 918 * 933 - * Returns 0 on success, or a negative error code if the string could not be 934 - * parsed. 919 + * Returns: 920 + * 0 on success, or a negative error code if the string could not be parsed. 935 921 */ 936 922 int iio_str_to_fixpoint(const char *str, int fract_mult, 937 923 int *integer, int *fract) ··· 1625 1611 * iio_device_alloc() - allocate an iio_dev from a driver 1626 1612 * @parent: Parent device. 1627 1613 * @sizeof_priv: Space to allocate for private structure. 1628 - **/ 1614 + * 1615 + * Returns: 1616 + * Pointer to allocated iio_dev on success, NULL on failure. 1617 + */ 1629 1618 struct iio_dev *iio_device_alloc(struct device *parent, int sizeof_priv) 1630 1619 { 1631 1620 struct iio_dev_opaque *iio_dev_opaque; ··· 1684 1667 /** 1685 1668 * iio_device_free() - free an iio_dev from a driver 1686 1669 * @dev: the iio_dev associated with the device 1687 - **/ 1670 + */ 1688 1671 void iio_device_free(struct iio_dev *dev) 1689 1672 { 1690 1673 if (dev) ··· 1705 1688 * Managed iio_device_alloc. iio_dev allocated with this function is 1706 1689 * automatically freed on driver detach. 1707 1690 * 1708 - * RETURNS: 1691 + * Returns: 1709 1692 * Pointer to allocated iio_dev on success, NULL on failure. 1710 1693 */ 1711 1694 struct iio_dev *devm_iio_device_alloc(struct device *parent, int sizeof_priv) ··· 1732 1715 * @filp: File structure for iio device used to keep and later access 1733 1716 * private data 1734 1717 * 1735 - * Return: 0 on success or -EBUSY if the device is already opened 1736 - **/ 1718 + * Returns: 0 on success or -EBUSY if the device is already opened 1719 + */ 1737 1720 static int iio_chrdev_open(struct inode *inode, struct file *filp) 1738 1721 { 1739 1722 struct iio_dev_opaque *iio_dev_opaque = ··· 1766 1749 * @inode: Inode structure pointer for the char device 1767 1750 * @filp: File structure pointer for the char device 1768 1751 * 1769 - * Return: 0 for successful release 1752 + * Returns: 0 for successful release. 1770 1753 */ 1771 1754 static int iio_chrdev_release(struct inode *inode, struct file *filp) 1772 1755 { ··· 1805 1788 1806 1789 mutex_lock(&iio_dev_opaque->info_exist_lock); 1807 1790 1808 - /** 1791 + /* 1809 1792 * The NULL check here is required to prevent crashing when a device 1810 1793 * is being removed while userspace would still have open file handles 1811 1794 * to try to access this device. ··· 1982 1965 /** 1983 1966 * iio_device_unregister() - unregister a device from the IIO subsystem 1984 1967 * @indio_dev: Device structure representing the device. 1985 - **/ 1968 + */ 1986 1969 void iio_device_unregister(struct iio_dev *indio_dev) 1987 1970 { 1988 1971 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); ··· 2033 2016 * 2034 2017 * Use with iio_device_release_direct_mode() 2035 2018 * 2036 - * Returns: 0 on success, -EBUSY on failure 2019 + * Returns: 0 on success, -EBUSY on failure. 2037 2020 */ 2038 2021 int iio_device_claim_direct_mode(struct iio_dev *indio_dev) 2039 2022 {