Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 626f090c authored by Yacine Belkadi's avatar Yacine Belkadi Committed by Greg Kroah-Hartman
Browse files

usb: fix some scripts/kernel-doc warnings



When building the htmldocs (in verbose mode), scripts/kernel-doc reports the
following type of warnings:

Warning(drivers/usb/core/usb.c:76): No description found for return value of
'usb_find_alt_setting'

Fix them by:
- adding some missing descriptions of return values
- using "Return" sections for those descriptions

Signed-off-by: default avatarYacine Belkadi <yacine.belkadi.1@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6b0a1cf7
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -43,10 +43,11 @@ static const size_t pool_max[HCD_BUFFER_POOLS] = {
 *
 *
 * Call this as part of initializing a host controller that uses the dma
 * Call this as part of initializing a host controller that uses the dma
 * memory allocators.  It initializes some pools of dma-coherent memory that
 * memory allocators.  It initializes some pools of dma-coherent memory that
 * will be shared by all drivers using that controller, or returns a negative
 * will be shared by all drivers using that controller.
 * errno value on error.
 *
 *
 * Call hcd_buffer_destroy() to clean up after using those pools.
 * Call hcd_buffer_destroy() to clean up after using those pools.
 *
 * Return: 0 if successful. A negative errno value otherwise.
 */
 */
int hcd_buffer_create(struct usb_hcd *hcd)
int hcd_buffer_create(struct usb_hcd *hcd)
{
{
+20 −2
Original line number Original line Diff line number Diff line
@@ -117,6 +117,8 @@ static DRIVER_ATTR(new_id, S_IRUGO | S_IWUSR, show_dynids, store_new_id);
 * @count: input size
 * @count: input size
 *
 *
 * Removes a dynamic usb device ID from this driver.
 * Removes a dynamic usb device ID from this driver.
 *
 * Return: @count on success. A negative error code otherwise.
 */
 */
static ssize_t
static ssize_t
store_remove_id(struct device_driver *driver, const char *buf, size_t count)
store_remove_id(struct device_driver *driver, const char *buf, size_t count)
@@ -457,6 +459,8 @@ static int usb_unbind_interface(struct device *dev)
 * Callers must own the device lock, so driver probe() entries don't need
 * Callers must own the device lock, so driver probe() entries don't need
 * extra locking, but other call contexts may need to explicitly claim that
 * extra locking, but other call contexts may need to explicitly claim that
 * lock.
 * lock.
 *
 * Return: 0 on success.
 */
 */
int usb_driver_claim_interface(struct usb_driver *driver,
int usb_driver_claim_interface(struct usb_driver *driver,
				struct usb_interface *iface, void *priv)
				struct usb_interface *iface, void *priv)
@@ -658,6 +662,8 @@ EXPORT_SYMBOL_GPL(usb_match_one_id);
 * These device tables are exported with MODULE_DEVICE_TABLE, through
 * These device tables are exported with MODULE_DEVICE_TABLE, through
 * modutils, to support the driver loading functionality of USB hotplugging.
 * modutils, to support the driver loading functionality of USB hotplugging.
 *
 *
 * Return: The first matching usb_device_id, or %NULL.
 *
 * What Matches:
 * What Matches:
 *
 *
 * The "match_flags" element in a usb_device_id controls which
 * The "match_flags" element in a usb_device_id controls which
@@ -823,7 +829,8 @@ static int usb_uevent(struct device *dev, struct kobj_uevent_env *env)
 * Registers a USB device driver with the USB core.  The list of
 * Registers a USB device driver with the USB core.  The list of
 * unattached devices will be rescanned whenever a new driver is
 * unattached devices will be rescanned whenever a new driver is
 * added, allowing the new driver to attach to any recognized devices.
 * added, allowing the new driver to attach to any recognized devices.
 * Returns a negative error code on failure and 0 on success.
 *
 * Return: A negative error code on failure and 0 on success.
 */
 */
int usb_register_device_driver(struct usb_device_driver *new_udriver,
int usb_register_device_driver(struct usb_device_driver *new_udriver,
		struct module *owner)
		struct module *owner)
@@ -879,7 +886,8 @@ EXPORT_SYMBOL_GPL(usb_deregister_device_driver);
 * Registers a USB interface driver with the USB core.  The list of
 * Registers a USB interface driver with the USB core.  The list of
 * unattached interfaces will be rescanned whenever a new driver is
 * unattached interfaces will be rescanned whenever a new driver is
 * added, allowing the new driver to attach to any recognized interfaces.
 * added, allowing the new driver to attach to any recognized interfaces.
 * Returns a negative error code on failure and 0 on success.
 *
 * Return: A negative error code on failure and 0 on success.
 *
 *
 * NOTE: if you want your driver to use the USB major number, you must call
 * NOTE: if you want your driver to use the USB major number, you must call
 * usb_register_dev() to enable that functionality.  This function no longer
 * usb_register_dev() to enable that functionality.  This function no longer
@@ -1213,6 +1221,8 @@ static int usb_resume_interface(struct usb_device *udev,
 * unpredictable times.
 * unpredictable times.
 *
 *
 * This routine can run only in process context.
 * This routine can run only in process context.
 *
 * Return: 0 if the suspend succeeded.
 */
 */
static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
{
{
@@ -1294,6 +1304,8 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
 * unpredictable times.
 * unpredictable times.
 *
 *
 * This routine can run only in process context.
 * This routine can run only in process context.
 *
 * Return: 0 on success.
 */
 */
static int usb_resume_both(struct usb_device *udev, pm_message_t msg)
static int usb_resume_both(struct usb_device *udev, pm_message_t msg)
{
{
@@ -1491,6 +1503,8 @@ void usb_autosuspend_device(struct usb_device *udev)
 * The caller must hold @udev's device lock.
 * The caller must hold @udev's device lock.
 *
 *
 * This routine can run only in process context.
 * This routine can run only in process context.
 *
 * Return: 0 on success. A negative error code otherwise.
 */
 */
int usb_autoresume_device(struct usb_device *udev)
int usb_autoresume_device(struct usb_device *udev)
{
{
@@ -1600,6 +1614,8 @@ EXPORT_SYMBOL_GPL(usb_autopm_put_interface_no_suspend);
 * However if the autoresume fails then the counter is re-decremented.
 * However if the autoresume fails then the counter is re-decremented.
 *
 *
 * This routine can run only in process context.
 * This routine can run only in process context.
 *
 * Return: 0 on success.
 */
 */
int usb_autopm_get_interface(struct usb_interface *intf)
int usb_autopm_get_interface(struct usb_interface *intf)
{
{
@@ -1633,6 +1649,8 @@ EXPORT_SYMBOL_GPL(usb_autopm_get_interface);
 * resumed.
 * resumed.
 *
 *
 * This routine can run in atomic context.
 * This routine can run in atomic context.
 *
 * Return: 0 on success. A negative error code otherwise.
 */
 */
int usb_autopm_get_interface_async(struct usb_interface *intf)
int usb_autopm_get_interface_async(struct usb_interface *intf)
{
{
+1 −1
Original line number Original line Diff line number Diff line
@@ -153,7 +153,7 @@ void usb_major_cleanup(void)
 * usb_deregister_dev() must be called when the driver is done with
 * usb_deregister_dev() must be called when the driver is done with
 * the minor numbers given out by this function.
 * the minor numbers given out by this function.
 *
 *
 * Returns -EINVAL if something bad happens with trying to register a
 * Return: -EINVAL if something bad happens with trying to register a
 * device, and 0 on success.
 * device, and 0 on success.
 */
 */
int usb_register_dev(struct usb_interface *intf,
int usb_register_dev(struct usb_interface *intf,
+2 −0
Original line number Original line Diff line number Diff line
@@ -171,6 +171,8 @@ static void ehci_wait_for_companions(struct pci_dev *pdev, struct usb_hcd *hcd,
 * through the hotplug entry's driver_data.
 * through the hotplug entry's driver_data.
 *
 *
 * Store this function in the HCD's struct pci_driver as probe().
 * Store this function in the HCD's struct pci_driver as probe().
 *
 * Return: 0 if successful.
 */
 */
int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
{
{
+27 −10
Original line number Original line Diff line number Diff line
@@ -378,9 +378,10 @@ MODULE_PARM_DESC(authorized_default,
 * @buf: Buffer for USB string descriptor (header + UTF-16LE)
 * @buf: Buffer for USB string descriptor (header + UTF-16LE)
 * @len: Length (in bytes; may be odd) of descriptor buffer.
 * @len: Length (in bytes; may be odd) of descriptor buffer.
 *
 *
 * The return value is the number of bytes filled in: 2 + 2*strlen(s) or
 * Return: The number of bytes filled in: 2 + 2*strlen(s) or @len,
 * buflen, whichever is less.
 * whichever is less.
 *
 *
 * Note:
 * USB String descriptors can contain at most 126 characters; input
 * USB String descriptors can contain at most 126 characters; input
 * strings longer than that are truncated.
 * strings longer than that are truncated.
 */
 */
@@ -416,7 +417,8 @@ ascii2desc(char const *s, u8 *buf, unsigned len)
 *
 *
 * Produces either a manufacturer, product or serial number string for the
 * Produces either a manufacturer, product or serial number string for the
 * virtual root hub device.
 * virtual root hub device.
 * Returns the number of bytes filled in: the length of the descriptor or
 *
 * Return: The number of bytes filled in: the length of the descriptor or
 * of the provided buffer, whichever is less.
 * of the provided buffer, whichever is less.
 */
 */
static unsigned
static unsigned
@@ -938,6 +940,8 @@ static void usb_bus_init (struct usb_bus *bus)
 *
 *
 * Assigns a bus number, and links the controller into usbcore data
 * Assigns a bus number, and links the controller into usbcore data
 * structures so that it can be seen by scanning the bus list.
 * structures so that it can be seen by scanning the bus list.
 *
 * Return: 0 if successful. A negative error code otherwise.
 */
 */
static int usb_register_bus(struct usb_bus *bus)
static int usb_register_bus(struct usb_bus *bus)
{
{
@@ -1002,6 +1006,8 @@ static void usb_deregister_bus (struct usb_bus *bus)
 * the device properly in the device tree and then calls usb_new_device()
 * the device properly in the device tree and then calls usb_new_device()
 * to register the usb device.  It also assigns the root hub's USB address
 * to register the usb device.  It also assigns the root hub's USB address
 * (always 1).
 * (always 1).
 *
 * Return: 0 if successful. A negative error code otherwise.
 */
 */
static int register_root_hub(struct usb_hcd *hcd)
static int register_root_hub(struct usb_hcd *hcd)
{
{
@@ -1108,7 +1114,9 @@ EXPORT_SYMBOL_GPL(usb_hcd_end_port_resume);
 * @isoc: true for isochronous transactions, false for interrupt ones
 * @isoc: true for isochronous transactions, false for interrupt ones
 * @bytecount: how many bytes in the transaction.
 * @bytecount: how many bytes in the transaction.
 *
 *
 * Returns approximate bus time in nanoseconds for a periodic transaction.
 * Return: Approximate bus time in nanoseconds for a periodic transaction.
 *
 * Note:
 * See USB 2.0 spec section 5.11.3; only periodic transfers need to be
 * See USB 2.0 spec section 5.11.3; only periodic transfers need to be
 * scheduled in software, this function is only used for such scheduling.
 * scheduled in software, this function is only used for such scheduling.
 */
 */
@@ -1166,7 +1174,7 @@ EXPORT_SYMBOL_GPL(usb_calc_bus_time);
 * be disabled.  The actions carried out here are required for URB
 * be disabled.  The actions carried out here are required for URB
 * submission, as well as for endpoint shutdown and for usb_kill_urb.
 * submission, as well as for endpoint shutdown and for usb_kill_urb.
 *
 *
 * Returns 0 for no error, otherwise a negative error code (in which case
 * Return: 0 for no error, otherwise a negative error code (in which case
 * the enqueue() method must fail).  If no error occurs but enqueue() fails
 * the enqueue() method must fail).  If no error occurs but enqueue() fails
 * anyway, it must call usb_hcd_unlink_urb_from_ep() before releasing
 * anyway, it must call usb_hcd_unlink_urb_from_ep() before releasing
 * the private spinlock and returning.
 * the private spinlock and returning.
@@ -1221,7 +1229,7 @@ EXPORT_SYMBOL_GPL(usb_hcd_link_urb_to_ep);
 * be disabled.  The actions carried out here are required for making
 * be disabled.  The actions carried out here are required for making
 * sure than an unlink is valid.
 * sure than an unlink is valid.
 *
 *
 * Returns 0 for no error, otherwise a negative error code (in which case
 * Return: 0 for no error, otherwise a negative error code (in which case
 * the dequeue() method must fail).  The possible error codes are:
 * the dequeue() method must fail).  The possible error codes are:
 *
 *
 *	-EIDRM: @urb was not submitted or has already completed.
 *	-EIDRM: @urb was not submitted or has already completed.
@@ -1784,7 +1792,7 @@ void usb_hcd_flush_endpoint(struct usb_device *udev,
 * pass in the current alternate interface setting in cur_alt,
 * pass in the current alternate interface setting in cur_alt,
 * and pass in the new alternate interface setting in new_alt.
 * and pass in the new alternate interface setting in new_alt.
 *
 *
 * Returns an error if the requested bandwidth change exceeds the
 * Return: An error if the requested bandwidth change exceeds the
 * bus bandwidth or host controller internal resources.
 * bus bandwidth or host controller internal resources.
 */
 */
int usb_hcd_alloc_bandwidth(struct usb_device *udev,
int usb_hcd_alloc_bandwidth(struct usb_device *udev,
@@ -1954,9 +1962,12 @@ void usb_hcd_reset_endpoint(struct usb_device *udev,
 * @num_streams:	number of streams to allocate.
 * @num_streams:	number of streams to allocate.
 * @mem_flags:		flags hcd should use to allocate memory.
 * @mem_flags:		flags hcd should use to allocate memory.
 *
 *
 * Sets up a group of bulk endpoints to have num_streams stream IDs available.
 * Sets up a group of bulk endpoints to have @num_streams stream IDs available.
 * Drivers may queue multiple transfers to different stream IDs, which may
 * Drivers may queue multiple transfers to different stream IDs, which may
 * complete in a different order than they were queued.
 * complete in a different order than they were queued.
 *
 * Return: On success, the number of allocated streams. On failure, a negative
 * error code.
 */
 */
int usb_alloc_streams(struct usb_interface *interface,
int usb_alloc_streams(struct usb_interface *interface,
		struct usb_host_endpoint **eps, unsigned int num_eps,
		struct usb_host_endpoint **eps, unsigned int num_eps,
@@ -2201,6 +2212,8 @@ EXPORT_SYMBOL_GPL(usb_hcd_resume_root_hub);
 * khubd identifying and possibly configuring the device.
 * khubd identifying and possibly configuring the device.
 * This is needed by OTG controller drivers, where it helps meet
 * This is needed by OTG controller drivers, where it helps meet
 * HNP protocol timing requirements for starting a port reset.
 * HNP protocol timing requirements for starting a port reset.
 *
 * Return: 0 if successful.
 */
 */
int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num)
int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num)
{
{
@@ -2235,6 +2248,8 @@ EXPORT_SYMBOL_GPL(usb_bus_start_enum);
 *
 *
 * If the controller isn't HALTed, calls the driver's irq handler.
 * If the controller isn't HALTed, calls the driver's irq handler.
 * Checks whether the controller is now dead.
 * Checks whether the controller is now dead.
 *
 * Return: %IRQ_HANDLED if the IRQ was handled. %IRQ_NONE otherwise.
 */
 */
irqreturn_t usb_hcd_irq (int irq, void *__hcd)
irqreturn_t usb_hcd_irq (int irq, void *__hcd)
{
{
@@ -2320,7 +2335,8 @@ EXPORT_SYMBOL_GPL (usb_hc_died);
 * HC driver's private data.  Initialize the generic members of the
 * HC driver's private data.  Initialize the generic members of the
 * hcd structure.
 * hcd structure.
 *
 *
 * If memory is unavailable, returns NULL.
 * Return: On success, a pointer to the created and initialized HCD structure.
 * On failure (e.g. if memory is unavailable), %NULL.
 */
 */
struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver,
struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver,
		struct device *dev, const char *bus_name,
		struct device *dev, const char *bus_name,
@@ -2384,7 +2400,8 @@ EXPORT_SYMBOL_GPL(usb_create_shared_hcd);
 * HC driver's private data.  Initialize the generic members of the
 * HC driver's private data.  Initialize the generic members of the
 * hcd structure.
 * hcd structure.
 *
 *
 * If memory is unavailable, returns NULL.
 * Return: On success, a pointer to the created and initialized HCD
 * structure. On failure (e.g. if memory is unavailable), %NULL.
 */
 */
struct usb_hcd *usb_create_hcd(const struct hc_driver *driver,
struct usb_hcd *usb_create_hcd(const struct hc_driver *driver,
		struct device *dev, const char *bus_name)
		struct device *dev, const char *bus_name)
Loading