drivercore: Generalize module_platform_driver
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 16 Nov 2011 09:13:35 +0000 (10:13 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Nov 2011 20:05:00 +0000 (12:05 -0800)
commit907d0ed1c84114d4e8dafd66af982515d3739c90
treefaf964abead72d572d686e25945ec237c9e635d2
parent377195c438fc5e9e4ca59e69382c10771d817d6a
drivercore: Generalize module_platform_driver

This patch generalizes the module_platform_driver macro and introduces a new
module_driver macro. The module_driver macro takes a driver name, a register
and a unregister function for this driver type. Using these it construct the
module init and exit sections which register and unregister the driver. Since
such init/exit sections are commonly found in drivers this macro can be used
to eliminate a lot of boilerplate code.

The macro is not intended to be used by driver modules directly, instead it
should be used to generate bus specific macros for registering drivers like
the module_platform_driver macro.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/linux/device.h
include/linux/platform_device.h
This page took 0.029911 seconds and 5 git commands to generate.