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

staging: comedi: comedi_usb.c: improve function documentation

Expand the descriptions of the functions and document the return values.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ian Abbott and committed by
Greg Kroah-Hartman
ddf837ea 127a0cf9

+52 -23
+52 -23
drivers/staging/comedi/comedi_usb.c
··· 21 21 #include "comedi_usb.h" 22 22 23 23 /** 24 - * comedi_to_usb_interface() - comedi_device pointer to usb_interface pointer. 25 - * @dev: comedi_device struct 24 + * comedi_to_usb_interface() - Return USB interface attached to COMEDI device 25 + * @dev: COMEDI device. 26 + * 27 + * Assuming @dev->hw_dev is non-%NULL, it is assumed to be pointing to a 28 + * a &struct device embedded in a &struct usb_interface. 29 + * 30 + * Return: Attached USB interface if @dev->hw_dev is non-%NULL. 31 + * Return %NULL if @dev->hw_dev is %NULL. 26 32 */ 27 33 struct usb_interface *comedi_to_usb_interface(struct comedi_device *dev) 28 34 { ··· 37 31 EXPORT_SYMBOL_GPL(comedi_to_usb_interface); 38 32 39 33 /** 40 - * comedi_to_usb_dev() - comedi_device pointer to usb_device pointer. 41 - * @dev: comedi_device struct 34 + * comedi_to_usb_dev() - Return USB device attached to COMEDI device 35 + * @dev: COMEDI device. 36 + * 37 + * Assuming @dev->hw_dev is non-%NULL, it is assumed to be pointing to a 38 + * a &struct device embedded in a &struct usb_interface. 39 + * 40 + * Return: USB device to which the USB interface belongs if @dev->hw_dev is 41 + * non-%NULL. Return %NULL if @dev->hw_dev is %NULL. 42 42 */ 43 43 struct usb_device *comedi_to_usb_dev(struct comedi_device *dev) 44 44 { ··· 55 43 EXPORT_SYMBOL_GPL(comedi_to_usb_dev); 56 44 57 45 /** 58 - * comedi_usb_auto_config() - Configure/probe a comedi USB driver. 59 - * @intf: usb_interface struct 60 - * @driver: comedi_driver struct 61 - * @context: driver specific data, passed to comedi_auto_config() 46 + * comedi_usb_auto_config() - Configure/probe a USB COMEDI driver 47 + * @intf: USB interface. 48 + * @driver: Registered COMEDI driver. 49 + * @context: Driver specific data, passed to comedi_auto_config(). 62 50 * 63 - * Typically called from the usb_driver (*probe) function. 51 + * Typically called from the usb_driver (*probe) function. Auto-configure a 52 + * COMEDI device, using a pointer to the &struct device embedded in *@intf as 53 + * the hardware device. The @context value gets passed through to @driver's 54 + * "auto_attach" handler. The "auto_attach" handler may call 55 + * comedi_to_usb_interface() on the passed in COMEDI device to recover @intf. 56 + * 57 + * Return: The result of calling comedi_auto_config() (%0 on success, or 58 + * a negative error number on failure). 64 59 */ 65 60 int comedi_usb_auto_config(struct usb_interface *intf, 66 61 struct comedi_driver *driver, ··· 78 59 EXPORT_SYMBOL_GPL(comedi_usb_auto_config); 79 60 80 61 /** 81 - * comedi_pci_auto_unconfig() - Unconfigure/disconnect a comedi USB driver. 82 - * @intf: usb_interface struct 62 + * comedi_usb_auto_unconfig() - Unconfigure/disconnect a USB COMEDI device 63 + * @intf: USB interface. 83 64 * 84 65 * Typically called from the usb_driver (*disconnect) function. 66 + * Auto-unconfigure a COMEDI device attached to this USB interface, using a 67 + * pointer to the &struct device embedded in *@intf as the hardware device. 68 + * The COMEDI driver's "detach" handler will be called during unconfiguration 69 + * of the COMEDI device. 70 + * 71 + * Note that the COMEDI device may have already been unconfigured using the 72 + * %COMEDI_DEVCONFIG ioctl, in which case this attempt to unconfigure it 73 + * again should be ignored. 85 74 */ 86 75 void comedi_usb_auto_unconfig(struct usb_interface *intf) 87 76 { ··· 98 71 EXPORT_SYMBOL_GPL(comedi_usb_auto_unconfig); 99 72 100 73 /** 101 - * comedi_usb_driver_register() - Register a comedi USB driver. 102 - * @comedi_driver: comedi_driver struct 103 - * @usb_driver: usb_driver struct 74 + * comedi_usb_driver_register() - Register a USB COMEDI driver 75 + * @comedi_driver: COMEDI driver to be registered. 76 + * @usb_driver: USB driver to be registered. 104 77 * 105 - * This function is used for the module_init() of comedi USB drivers. 106 - * Do not call it directly, use the module_comedi_usb_driver() helper 107 - * macro instead. 78 + * This function is called from the module_init() of USB COMEDI driver modules 79 + * to register the COMEDI driver and the USB driver. Do not call it directly, 80 + * use the module_comedi_usb_driver() helper macro instead. 81 + * 82 + * Return: %0 on success, or a negative error number on failure. 108 83 */ 109 84 int comedi_usb_driver_register(struct comedi_driver *comedi_driver, 110 85 struct usb_driver *usb_driver) ··· 128 99 EXPORT_SYMBOL_GPL(comedi_usb_driver_register); 129 100 130 101 /** 131 - * comedi_usb_driver_unregister() - Unregister a comedi USB driver. 132 - * @comedi_driver: comedi_driver struct 133 - * @usb_driver: usb_driver struct 102 + * comedi_usb_driver_unregister() - Unregister a USB COMEDI driver 103 + * @comedi_driver: COMEDI driver to be registered. 104 + * @usb_driver: USB driver to be registered. 134 105 * 135 - * This function is used for the module_exit() of comedi USB drivers. 136 - * Do not call it directly, use the module_comedi_usb_driver() helper 137 - * macro instead. 106 + * This function is called from the module_exit() of USB COMEDI driver modules 107 + * to unregister the USB driver and the COMEDI driver. Do not call it 108 + * directly, use the module_comedi_usb_driver() helper macro instead. 138 109 */ 139 110 void comedi_usb_driver_unregister(struct comedi_driver *comedi_driver, 140 111 struct usb_driver *usb_driver)