aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/message.c
diff options
context:
space:
mode:
authorYacine Belkadi <yacine.belkadi.1@gmail.com>2013-08-02 14:10:04 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-02 23:30:14 -0400
commit626f090c5cbbe557379978c7a9525011ad7fbbf6 (patch)
treea79ab527b8c1f21067d8d5126b029917bc0b838c /drivers/usb/core/message.c
parent6b0a1cf732f917f2eaccb4a0dd6ae7bfc3ccda15 (diff)
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: Yacine Belkadi <yacine.belkadi.1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/message.c')
-rw-r--r--drivers/usb/core/message.c49
1 files changed, 27 insertions, 22 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 6549a975b0c5..82927e1ed27d 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -119,15 +119,15 @@ static int usb_internal_control_msg(struct usb_device *usb_dev,
119 * This function sends a simple control message to a specified endpoint and 119 * This function sends a simple control message to a specified endpoint and
120 * waits for the message to complete, or timeout. 120 * waits for the message to complete, or timeout.
121 * 121 *
122 * If successful, it returns the number of bytes transferred, otherwise a
123 * negative error number.
124 *
125 * Don't use this function from within an interrupt context, like a bottom half 122 * Don't use this function from within an interrupt context, like a bottom half
126 * handler. If you need an asynchronous message, or need to send a message 123 * handler. If you need an asynchronous message, or need to send a message
127 * from within interrupt context, use usb_submit_urb(). 124 * from within interrupt context, use usb_submit_urb().
128 * If a thread in your driver uses this call, make sure your disconnect() 125 * If a thread in your driver uses this call, make sure your disconnect()
129 * method can wait for it to complete. Since you don't have a handle on the 126 * method can wait for it to complete. Since you don't have a handle on the
130 * URB used, you can't cancel the request. 127 * URB used, you can't cancel the request.
128 *
129 * Return: If successful, the number of bytes transferred. Otherwise, a negative
130 * error number.
131 */ 131 */
132int usb_control_msg(struct usb_device *dev, unsigned int pipe, __u8 request, 132int usb_control_msg(struct usb_device *dev, unsigned int pipe, __u8 request,
133 __u8 requesttype, __u16 value, __u16 index, void *data, 133 __u8 requesttype, __u16 value, __u16 index, void *data,
@@ -170,15 +170,16 @@ EXPORT_SYMBOL_GPL(usb_control_msg);
170 * This function sends a simple interrupt message to a specified endpoint and 170 * This function sends a simple interrupt message to a specified endpoint and
171 * waits for the message to complete, or timeout. 171 * waits for the message to complete, or timeout.
172 * 172 *
173 * If successful, it returns 0, otherwise a negative error number. The number
174 * of actual bytes transferred will be stored in the actual_length paramater.
175 *
176 * Don't use this function from within an interrupt context, like a bottom half 173 * Don't use this function from within an interrupt context, like a bottom half
177 * handler. If you need an asynchronous message, or need to send a message 174 * handler. If you need an asynchronous message, or need to send a message
178 * from within interrupt context, use usb_submit_urb() If a thread in your 175 * from within interrupt context, use usb_submit_urb() If a thread in your
179 * driver uses this call, make sure your disconnect() method can wait for it to 176 * driver uses this call, make sure your disconnect() method can wait for it to
180 * complete. Since you don't have a handle on the URB used, you can't cancel 177 * complete. Since you don't have a handle on the URB used, you can't cancel
181 * the request. 178 * the request.
179 *
180 * Return:
181 * If successful, 0. Otherwise a negative error number. The number of actual
182 * bytes transferred will be stored in the @actual_length paramater.
182 */ 183 */
183int usb_interrupt_msg(struct usb_device *usb_dev, unsigned int pipe, 184int usb_interrupt_msg(struct usb_device *usb_dev, unsigned int pipe,
184 void *data, int len, int *actual_length, int timeout) 185 void *data, int len, int *actual_length, int timeout)
@@ -203,9 +204,6 @@ EXPORT_SYMBOL_GPL(usb_interrupt_msg);
203 * This function sends a simple bulk message to a specified endpoint 204 * This function sends a simple bulk message to a specified endpoint
204 * and waits for the message to complete, or timeout. 205 * and waits for the message to complete, or timeout.
205 * 206 *
206 * If successful, it returns 0, otherwise a negative error number. The number
207 * of actual bytes transferred will be stored in the actual_length paramater.
208 *
209 * Don't use this function from within an interrupt context, like a bottom half 207 * Don't use this function from within an interrupt context, like a bottom half
210 * handler. If you need an asynchronous message, or need to send a message 208 * handler. If you need an asynchronous message, or need to send a message
211 * from within interrupt context, use usb_submit_urb() If a thread in your 209 * from within interrupt context, use usb_submit_urb() If a thread in your
@@ -217,6 +215,11 @@ EXPORT_SYMBOL_GPL(usb_interrupt_msg);
217 * users are forced to abuse this routine by using it to submit URBs for 215 * users are forced to abuse this routine by using it to submit URBs for
218 * interrupt endpoints. We will take the liberty of creating an interrupt URB 216 * interrupt endpoints. We will take the liberty of creating an interrupt URB
219 * (with the default interval) if the target is an interrupt endpoint. 217 * (with the default interval) if the target is an interrupt endpoint.
218 *
219 * Return:
220 * If successful, 0. Otherwise a negative error number. The number of actual
221 * bytes transferred will be stored in the @actual_length paramater.
222 *
220 */ 223 */
221int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, 224int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
222 void *data, int len, int *actual_length, int timeout) 225 void *data, int len, int *actual_length, int timeout)
@@ -341,9 +344,9 @@ static void sg_complete(struct urb *urb)
341 * send every byte identified in the list. 344 * send every byte identified in the list.
342 * @mem_flags: SLAB_* flags affecting memory allocations in this call 345 * @mem_flags: SLAB_* flags affecting memory allocations in this call
343 * 346 *
344 * Returns zero for success, else a negative errno value. This initializes a 347 * This initializes a scatter/gather request, allocating resources such as
345 * scatter/gather request, allocating resources such as I/O mappings and urb 348 * I/O mappings and urb memory (except maybe memory used by USB controller
346 * memory (except maybe memory used by USB controller drivers). 349 * drivers).
347 * 350 *
348 * The request must be issued using usb_sg_wait(), which waits for the I/O to 351 * The request must be issued using usb_sg_wait(), which waits for the I/O to
349 * complete (or to be canceled) and then cleans up all resources allocated by 352 * complete (or to be canceled) and then cleans up all resources allocated by
@@ -351,6 +354,8 @@ static void sg_complete(struct urb *urb)
351 * 354 *
352 * The request may be canceled with usb_sg_cancel(), either before or after 355 * The request may be canceled with usb_sg_cancel(), either before or after
353 * usb_sg_wait() is called. 356 * usb_sg_wait() is called.
357 *
358 * Return: Zero for success, else a negative errno value.
354 */ 359 */
355int usb_sg_init(struct usb_sg_request *io, struct usb_device *dev, 360int usb_sg_init(struct usb_sg_request *io, struct usb_device *dev,
356 unsigned pipe, unsigned period, struct scatterlist *sg, 361 unsigned pipe, unsigned period, struct scatterlist *sg,
@@ -623,7 +628,7 @@ EXPORT_SYMBOL_GPL(usb_sg_cancel);
623 * 628 *
624 * This call is synchronous, and may not be used in an interrupt context. 629 * This call is synchronous, and may not be used in an interrupt context.
625 * 630 *
626 * Returns the number of bytes received on success, or else the status code 631 * Return: The number of bytes received on success, or else the status code
627 * returned by the underlying usb_control_msg() call. 632 * returned by the underlying usb_control_msg() call.
628 */ 633 */
629int usb_get_descriptor(struct usb_device *dev, unsigned char type, 634int usb_get_descriptor(struct usb_device *dev, unsigned char type,
@@ -671,7 +676,7 @@ EXPORT_SYMBOL_GPL(usb_get_descriptor);
671 * 676 *
672 * This call is synchronous, and may not be used in an interrupt context. 677 * This call is synchronous, and may not be used in an interrupt context.
673 * 678 *
674 * Returns the number of bytes received on success, or else the status code 679 * Return: The number of bytes received on success, or else the status code
675 * returned by the underlying usb_control_msg() call. 680 * returned by the underlying usb_control_msg() call.
676 */ 681 */
677static int usb_get_string(struct usb_device *dev, unsigned short langid, 682static int usb_get_string(struct usb_device *dev, unsigned short langid,
@@ -805,7 +810,7 @@ static int usb_get_langid(struct usb_device *dev, unsigned char *tbuf)
805 * 810 *
806 * This call is synchronous, and may not be used in an interrupt context. 811 * This call is synchronous, and may not be used in an interrupt context.
807 * 812 *
808 * Returns length of the string (>= 0) or usb_control_msg status (< 0). 813 * Return: length of the string (>= 0) or usb_control_msg status (< 0).
809 */ 814 */
810int usb_string(struct usb_device *dev, int index, char *buf, size_t size) 815int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
811{ 816{
@@ -853,8 +858,8 @@ EXPORT_SYMBOL_GPL(usb_string);
853 * @udev: the device whose string descriptor is being read 858 * @udev: the device whose string descriptor is being read
854 * @index: the descriptor index 859 * @index: the descriptor index
855 * 860 *
856 * Returns a pointer to a kmalloc'ed buffer containing the descriptor string, 861 * Return: A pointer to a kmalloc'ed buffer containing the descriptor string,
857 * or NULL if the index is 0 or the string could not be read. 862 * or %NULL if the index is 0 or the string could not be read.
858 */ 863 */
859char *usb_cache_string(struct usb_device *udev, int index) 864char *usb_cache_string(struct usb_device *udev, int index)
860{ 865{
@@ -894,7 +899,7 @@ char *usb_cache_string(struct usb_device *udev, int index)
894 * 899 *
895 * This call is synchronous, and may not be used in an interrupt context. 900 * This call is synchronous, and may not be used in an interrupt context.
896 * 901 *
897 * Returns the number of bytes received on success, or else the status code 902 * Return: The number of bytes received on success, or else the status code
898 * returned by the underlying usb_control_msg() call. 903 * returned by the underlying usb_control_msg() call.
899 */ 904 */
900int usb_get_device_descriptor(struct usb_device *dev, unsigned int size) 905int usb_get_device_descriptor(struct usb_device *dev, unsigned int size)
@@ -980,7 +985,7 @@ EXPORT_SYMBOL_GPL(usb_get_status);
980 * 985 *
981 * This call is synchronous, and may not be used in an interrupt context. 986 * This call is synchronous, and may not be used in an interrupt context.
982 * 987 *
983 * Returns zero on success, or else the status code returned by the 988 * Return: Zero on success, or else the status code returned by the
984 * underlying usb_control_msg() call. 989 * underlying usb_control_msg() call.
985 */ 990 */
986int usb_clear_halt(struct usb_device *dev, int pipe) 991int usb_clear_halt(struct usb_device *dev, int pipe)
@@ -1277,7 +1282,7 @@ void usb_enable_interface(struct usb_device *dev,
1277 * endpoints in that interface; all such urbs must first be completed 1282 * endpoints in that interface; all such urbs must first be completed
1278 * (perhaps forced by unlinking). 1283 * (perhaps forced by unlinking).
1279 * 1284 *
1280 * Returns zero on success, or else the status code returned by the 1285 * Return: Zero on success, or else the status code returned by the
1281 * underlying usb_control_msg() call. 1286 * underlying usb_control_msg() call.
1282 */ 1287 */
1283int usb_set_interface(struct usb_device *dev, int interface, int alternate) 1288int usb_set_interface(struct usb_device *dev, int interface, int alternate)
@@ -1431,7 +1436,7 @@ EXPORT_SYMBOL_GPL(usb_set_interface);
1431 * 1436 *
1432 * The caller must own the device lock. 1437 * The caller must own the device lock.
1433 * 1438 *
1434 * Returns zero on success, else a negative error code. 1439 * Return: Zero on success, else a negative error code.
1435 */ 1440 */
1436int usb_reset_configuration(struct usb_device *dev) 1441int usb_reset_configuration(struct usb_device *dev)
1437{ 1442{
@@ -1973,7 +1978,7 @@ static void cancel_async_set_config(struct usb_device *udev)
1973 * routine gets around the normal restrictions by using a work thread to 1978 * routine gets around the normal restrictions by using a work thread to
1974 * submit the change-config request. 1979 * submit the change-config request.
1975 * 1980 *
1976 * Returns 0 if the request was successfully queued, error code otherwise. 1981 * Return: 0 if the request was successfully queued, error code otherwise.
1977 * The caller has no way to know whether the queued request will eventually 1982 * The caller has no way to know whether the queued request will eventually
1978 * succeed. 1983 * succeed.
1979 */ 1984 */