staging: comedi: Add helper macro for comedi pci driver boilerplate
authorH Hartley Sweeten <hartleys@visionengravers.com>
Fri, 11 May 2012 23:15:39 +0000 (16:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 May 2012 20:48:47 +0000 (13:48 -0700)
commitd4899c6ff86ea9836c89250cb2127aa64765b35a
treec77672087fe5d0cde437e64c2bfb08f80b036d96
parent5a81b4a0b673bf34823191a83318377c0e66e713
staging: comedi: Add helper macro for comedi pci driver boilerplate

Introduce the module_comedi_pci_driver macro, and the
associated register/unregister functions, which is a
convenience macro for comedi pci 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 pci
driver. By using this macro it is possible to eliminate
a few lines of boilerplate code per comedi pci driver.

Add a check to make sure that the pci_driver->name is
set. Once all the comedi pci drivers have been fixed this
will be removed.

Also, when registering the pci 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
This page took 0.030013 seconds and 5 git commands to generate.