- 17 5月, 2013 40 次提交
-
-
由 H Hartley Sweeten 提交于
For aesthetic reasons, instead of passing the struct usb_dt9812 pointer, pass the comedi_device pointer to this function. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
For aesthetic reasons, instead of passing the struct usb_dt9812 pointer, pass the comedi_device pointer to this function. Tidy up the function and use the comedi_device class_dev for the dev_err() message. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
For aesthetic reasons, instead of passing the 'slot' pointer, pass the comedi_device pointer to this function and rename the local var 'result' to simply 'ret'. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
For aesthetic reasons, instead of passing the 'slot' pointer, pass the comedi_device pointer to this function and rename the local var 'result' to simply 'ret'. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
For aesthetic reasons, instead of passing the 'slot' pointer, pass the comedi_device pointer to this function and rename the local var 'result' to simply 'ret'. Also, initialize the 'reg', and 'value' when they are declared. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
For aesthetic reasons, instead of passing the 'slot' pointer, pass the comedi_device pointer to this function and rename the local var 'result' to simply 'ret'. Remove the commented out printk(). Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
To clarify the code, add a local variable for the struct usb_device pointer used in the usb_blk_msg() calls. It's not necessary to initialize the 'count' when writing to the usb device. The 'count' variable is used to get back the number of bytes actually sent. Just return the usb_blk_msg() result when it is the last operation in a function. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Currently this driver supports attaching 16 usb devices to 16 comedi devices. The user can pass the 32-bit serial number of the usb device when attaching to force a comedi device to attach to a specific usb device. It's also possible to attach a comedi device without having an attached usb device. When the device is first opened the comedi_device (*open) function in this driver then checks to see if a usb device has been attached. If so the subdevice information is updated based on the usb device and the comedi device is then operational. If a usb device is not attached the (*open) returns -ENODEV. To simplify converting this driver to the comedi (*auto_attach) mechanism, remove the attaching by serial number option. Modify the usb (*probe) so that the first available slot is used. If all the slots are used return -ENODEV. Modify the comedi (*attach) so that the first unused slot that has an attached usb device is used. If all the slots are used return -ENODEV. Since this ensures that the comedi device has an attached usb device, remove the (*open) function and fully initialize the subdevices during the (*attach). Fix the comedi (*detach) so that the slot is made available after detaching. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Because of the usb (*probe) and comedi (*attach) disconnect, the struct slot_dt9812 is used to pass the device data between the usb_driver and the comedi_driver. The variable 'comedi' in this struct is used during the comedi (*attach) to indicate if a slot is currently being used. For aesthetic reasons, rename the variable to 'devpriv' since that is what is actually saved in the pointer. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
The comedi private data (dev->private) for this driver is stored in a 'struct comedi_dt9812' that is allocated during the comedi (*attach). For aesthetic reasons, rename this struct to help make its use clearer. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
In preparation of converting this manually attached comedi driver into an auto attached comedi usb driver, move the usb framework functions to the end of the file. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Remove the sanity check of devpriv, this function can only be called by the comedi core if the private data is allocated. Get the 'chan', 'range' and 'rngmask' from the function parameters when the local variables are declared. For aesthetic reasons, rename the local variable 'err' to 'ret' since that name is more standard. (*insn_read) functions are supposed to return the number of values read or an error code. Change the final return to 'insn->n' to make it clearer. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Introduce a helper function to set the buffer used to transfer commands to the usb device. Each command consists of four uint8_t values that are stored at specific indexes in the buffer. The helper function consolidates the code that sets the buffer to reduce coding errors and make the driver a bit easier to understand. Note, the '0xff & rngmask' can be reduced to simply 'rngmask' since the rngmask is always an 8-bit value. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Rename this CamelCase function to fix the checkpatch.pl warning. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Rename the local variable to fix the checkpatch.pl warning. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Absorb the usbduxfastsub_stop(), usbduxfastsub_upload(), and usbduxfastsub_start() functions into usbduxfast_upload_firmware(). Each of them just do a usb_control_msg() to the device and output an error message if it fails. A similar message is also output by usbduxfast_upload_firmware() so the extra messages are redundant. We can also share the malloc'ed local buffer needed for the usb_control_msg(). Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
For aesthetic reasons, move usbduxfast_upload_firmware() near its only caller, usbduxfast_request_firmware(). Also, move the #define for the maximum firmware size so it's with the other firmware defines. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Rename the CamelCase function and just pass the const struct firmware * directly instead of parsing out the data and size. Rename the CamelCasae local val 'fwBuf'. Use goto to provide a common exit path that frees the local buffer for the firmware when an error is encountered. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Fix a line over 80 characters issue reported by checkpatch.pl. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Remove the unnecessary comments and dev_err() noise. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Remove the devpriv sanity check, all the callers have previously verified that its valid. Absorb usbduxfast_unlink_urbs() into this function since it's the only caller and the only thing it does is call usb_kill_urb(). This function will always succeed so just return 0 and remove the local variable 'ret'. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Rename this function so it has namespace associated with the driver. Remove the local variables 'j' and 'ret'. They are not used and the function always returns '0'. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Rename this function so it has namespace associated with the driver. For aesthetic reasons, rename the local variable 'tmp' to 'ret' as this is more common for checking errno values. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
A dev_err() message is output if send_dux_commands() fails. Remove the extra dev_err() messages output by the callers. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
For aesthetic reasons, rename this variable to 'duxbuf' and also rename the define used for its size. This helps fix some of the > 80 char lines reported by checkpatch.pl. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
For aesthetic reasons, rename this variable to 'inbuf' to match the define used for its size (SIZEINBUF). Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
This buffer space is kmalloc'ed and free'ed but never used. Just remove it. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Rename the CamelCase variable 'urbIn' in the private data to simply 'urb'. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
The usb_device pointer can be fetched when needed from the comedi_device by using comedi_to_usb_interface() then interface_to_usbdev(). Do that instead and remove the pointer from the private data. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
The usb_interface pointer is already saved in the comedi_device by the comedi core. Remove the pointer from the private data and use comedi_to_usb_interface() to get the usb_interface when needed. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
For consistency in the driver, change all the dev_{level} messages so they use dev->class_dev for the device. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Now that the comedi_device is passed to the internal functions, the back pointer to it is not needed in the private data. Remove it. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Instead of passing the private data to the internal functions, pass the comedi_device pointer and get the private data from it. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
The interface number is only needed during the attach of the device. Remove it from the private data. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
The subdevice function pointers are only setup if the device is attached. The 'attached' flag in the private data is unnecessary. Remove it. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
The 'probed' flag in the private data was used to handle the disconnect between the usb (*probe) and the comedi_driver (*auto_attach) so that if the comedi_driver was attached without an associated usb_device the subdevice functions would return -ENODEV. Now that the usb_driver (*probe) is part of the comedi_driver (*auto_attach), the comedi_driver can only attach if the usb device is present. Remove the unnecessary variable from the private data and its uses in the driver. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Now that the usb (*probe) is handled in the comedi_driver (*auto_attach) the comedi_driver (*detach) will be called automatically if the attach fails. The tidy_up() calls in the (*auto_attach) are not needed. Remove them and absorb the code in tidy_up() into the (*detach). Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Now that the private data is kzalloc'ed when the device is attached, the NUMUSBDUXFAST define is not used. Remove it. The SUBDEV_AD define is only used when setting up the subdevice. Remove it and just open-code the value. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
Currently, the usb_driver (*probe) locates a free place in the static usbduxfast array to use for the private data in this driver. It then does some initial setup of the usb device and allocates the buffers needed. The firmware for the device is then requested and uploaded before calling comedi_usb_auto_config() to allow the comedi core to complete the (*auto_attach) of the device. Move the bulk of the (*probe) into the comedi_driver (*auto_attach). This allows the private data to be kzalloc'ed. We can then remove the static array along with the semaphore that protected it. This also removes the 16 attached devices limitation. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 H Hartley Sweeten 提交于
The usb_driver (*disconnect) calls comedi_usb_auto_unconfig() then frees any allocations by calling tidy_up(). comedi_usb_auto_unconfig() calls the comedi_driver (*detach) function, usbduxfast_detach(). Move the tidy_up() call into usbduxfast_detach() and use the comedi_usb_auto_unconfig() directly for the (*disconnect). Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-