Re: [PATCH 0/5] Generalize module_platform_driver

From: Greg KH
Date: Wed Nov 16 2011 - 11:13:11 EST


On Wed, Nov 16, 2011 at 10:13:34AM +0100, Lars-Peter Clausen wrote:
> Grant Likely recently introduced the module_platform_driver macro which can be
> used to eliminate a few lines on boilerplate code in platform driver modules.
> The same approach can be used to do the same for other bus type drivers.
>
> The first patch of this series generalizes the module_platform_driver macro and
> introduces the module_driver macro. It is similar to module_platform_driver
> macro but has two additional parameters to pass in the driver register and
> unregister function. The intend is that this macro is used to construct bus
> specific macros for generating the driver register/unregister boilerplate code.
>
> The next two patches in this series add the module_i2c_driver and
> module_spi_driver macro which use the module_driver macro to generate the I2C
> and SPI driver boilerplate code.
>
> The last two patches convert the driver found in the IIO framework to use the
> new module_i2c_driver and module_spi_driver macros to demonstrate their
> potential and remove over 700 lines of code.
>
> While this series only introduces these kind of helper macros for I2C and SPI
> bus drivers the same scheme should be applicable to most other bus driver types.
> For example PCI and USB seem to be good candidates.
>
> It probably makes sense to merge the first three patches together. The last two
> can probably, since this is not urgent, wait until the first three have reached
> mainline.

Nice, I like this, unless people object, I'll merge the first patch to
the driver-core tree.

I'll gladly take the i2c and spi patches as well if the subsystem
maintainers there don't object, and I'll work on the USB patch as well.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/