staging: comedi: Add helper macro for comedi usb driver boilerplate
authorH Hartley Sweeten <hartleys@visionengravers.com>
Thu, 17 May 2012 01:18:52 +0000 (18:18 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 May 2012 02:19:06 +0000 (19:19 -0700)
commit64255031bde68bd0f7ec934b83842619d513cf91
tree9a217b39afe078045ff0740a2b2b4502e4d056fc
parentd896e0e4f45e925b2bf9a800ca85e613d68e2888
staging: comedi: Add helper macro for comedi usb driver boilerplate

Introduce the module_comedi_usb_driver macro, and the
associated register/unregister functions, which is a
convenience macro for comedi usb driver modules similar
to module_platform_driver. It is intended to be used by
drivers where the init/exit section does nothing but
register/unregister the comedi driver and associated usb
driver. By using this macro it is possible to eliminate
a few lines of boilerplate code per comedi usb driver.

Also, when registering the usb driver check for failure
and unregister the comedi driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/comedidev.h
drivers/staging/comedi/drivers.c