[PATCH 00/18] staging: comedi: tidy up usbdux drivers

Ian Abbott abbotti at mev.co.uk
Tue Jul 30 09:34:52 UTC 2013


On 2013-07-30 01:42, H Hartley Sweeten wrote:
> The usbdux and usbduxsigma drivers are very similar and should be able
> to share some common code.
>
> Tidy up the drivers a bit so that the common pieces can be located and
> pulled out.
>
> H Hartley Sweeten (18):
>    staging: comedi: usbdux: generalize the usb_submit_urb functions
>    staging: comedi: usbduxsigma: generalize the ai/ao usb_kill_urb()
>    staging: comedi: usbduxsigma: remove the usb endpoint defines
>    staging: comedi: usbdux: tidy up usbdux_pwm_period()
>    staging: comedi: usbdux: tidy up usbdux_pwm_pattern()
>    staging: comedi: usbdux: tidy up usbdux_pwm_write()
>    staging: comedi: usbdux: remove usbdux_pwm_read()
>    staging: comedi: usbdux: tidy up usbdux_pwm_config()
>    staging: comedi: usbdux: return void from usbdux_pwm_pattern()
>    staging: comedi: usbduxsigma: return void from usbduxsigma_pwm_pattern()
>    staging: comedi: usbdux: tidy up usbdux_alloc_usb_buffers()
>    staging: comedi: usbduxsigma: 'dac_commands' does not need to be kzalloc()'d
>    staging: comedi: usbduxsigma: init 'pwm_buf_sz' in usbduxsigma_auto_attach()
>    staging: comedi: usbduxsigma: move urb unlink into usbduxsigma_detach()
>    staging: comedi: usbduxsigma: always clear the usb intfdata in (*detach)
>    staging: comedi: usbdux: tidy up usbdux_detach()
>    staging: comedi: usbdux: tidy up usbdux_free_usb_buffers()
>    staging: comedi: usbduxsigma: absorb usbduxsigma_attach_common() into caller
>
>   drivers/staging/comedi/drivers/usbdux.c      | 242 +++++++++--------------
>   drivers/staging/comedi/drivers/usbduxsigma.c | 276 ++++++++++++---------------
>   2 files changed, 207 insertions(+), 311 deletions(-)

Looks fine!  I was a little worried about not checking for a NULL 
pointer before calling usb_kill_urb() in patch 02, but it can cope with 
that.

Reviewed-by: Ian Abbott <abbotti at mev.co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti at mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-


More information about the devel mailing list