From: Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
To: Greg Kroah-Hartman <gregkh-l3A5Bk7waGM@public.gmane.org>,
Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
Grant Likely
<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Michael Hennerich
<Michael.Hennerich-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>,
<linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
<linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
<spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
Subject: [PATCH 0/5] Generalize module_platform_driver
Date: Wed, 16 Nov 2011 10:13:34 +0100 [thread overview]
Message-ID: <1321434819-23678-1-git-send-email-lars@metafoo.de> (raw)
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.
- Lars
Lars-Peter Clausen (5):
drivercore: Generalize module_platform_driver
I2C: Add helper macro for i2c_driver boilerplate
SPI: Add helper macro for spi_driver boilerplate
staging:iio: Use module_i2c_driver to register I2C drivers
staging:iio: Use module_spi_driver to register SPI driver
drivers/staging/iio/accel/adis16201_core.c | 13 +------------
drivers/staging/iio/accel/adis16203_core.c | 13 +------------
drivers/staging/iio/accel/adis16204_core.c | 13 +------------
drivers/staging/iio/accel/adis16209_core.c | 13 +------------
drivers/staging/iio/accel/adis16220_core.c | 13 +------------
drivers/staging/iio/accel/adis16240_core.c | 13 +------------
drivers/staging/iio/accel/kxsd9.c | 13 +------------
drivers/staging/iio/accel/lis3l02dq_core.c | 13 +------------
drivers/staging/iio/accel/sca3000_core.c | 13 +------------
drivers/staging/iio/adc/ad7192.c | 13 +------------
drivers/staging/iio/adc/ad7280a.c | 13 +------------
drivers/staging/iio/adc/ad7291.c | 14 +-------------
drivers/staging/iio/adc/ad7298_core.c | 13 +------------
drivers/staging/iio/adc/ad7476_core.c | 13 +------------
drivers/staging/iio/adc/ad7606_spi.c | 13 +------------
drivers/staging/iio/adc/ad7780.c | 13 +------------
drivers/staging/iio/adc/ad7793.c | 13 +------------
drivers/staging/iio/adc/ad7816.c | 14 +-------------
drivers/staging/iio/adc/ad7887_core.c | 13 +------------
drivers/staging/iio/adc/ad799x_core.c | 14 +-------------
drivers/staging/iio/adc/adt7310.c | 14 +-------------
drivers/staging/iio/adc/adt7410.c | 14 +-------------
drivers/staging/iio/adc/max1363_core.c | 14 +-------------
drivers/staging/iio/addac/adt7316-i2c.c | 14 +-------------
drivers/staging/iio/addac/adt7316-spi.c | 14 +-------------
drivers/staging/iio/cdc/ad7150.c | 14 +-------------
drivers/staging/iio/cdc/ad7152.c | 14 +-------------
drivers/staging/iio/cdc/ad7746.c | 14 +-------------
drivers/staging/iio/dac/ad5064.c | 13 +------------
drivers/staging/iio/dac/ad5360.c | 13 +------------
drivers/staging/iio/dac/ad5446.c | 13 +------------
drivers/staging/iio/dac/ad5504.c | 13 +------------
drivers/staging/iio/dac/ad5624r_spi.c | 13 +------------
drivers/staging/iio/dac/ad5686.c | 13 +------------
drivers/staging/iio/dac/ad5791.c | 13 +------------
drivers/staging/iio/dac/max517.c | 14 +-------------
drivers/staging/iio/dds/ad5930.c | 13 +------------
drivers/staging/iio/dds/ad9832.c | 13 +------------
drivers/staging/iio/dds/ad9834.c | 13 +------------
drivers/staging/iio/dds/ad9850.c | 13 +------------
drivers/staging/iio/dds/ad9852.c | 13 +------------
drivers/staging/iio/dds/ad9910.c | 13 +------------
drivers/staging/iio/dds/ad9951.c | 13 +------------
drivers/staging/iio/gyro/adis16080_core.c | 13 +------------
drivers/staging/iio/gyro/adis16130_core.c | 13 +------------
drivers/staging/iio/gyro/adis16260_core.c | 13 +------------
drivers/staging/iio/gyro/adxrs450_core.c | 13 +------------
drivers/staging/iio/impedance-analyzer/ad5933.c | 13 +------------
drivers/staging/iio/imu/adis16400_core.c | 13 +------------
drivers/staging/iio/light/isl29018.c | 14 +-------------
drivers/staging/iio/light/tsl2563.c | 14 +-------------
drivers/staging/iio/light/tsl2583.c | 14 +-------------
drivers/staging/iio/magnetometer/ak8975.c | 14 +-------------
drivers/staging/iio/magnetometer/hmc5843.c | 14 +-------------
drivers/staging/iio/meter/ade7753.c | 13 +------------
drivers/staging/iio/meter/ade7754.c | 13 +------------
drivers/staging/iio/meter/ade7758_core.c | 13 +------------
drivers/staging/iio/meter/ade7759.c | 13 +------------
drivers/staging/iio/meter/ade7854-i2c.c | 14 +-------------
drivers/staging/iio/meter/ade7854-spi.c | 13 +------------
drivers/staging/iio/resolver/ad2s1200.c | 13 +------------
drivers/staging/iio/resolver/ad2s1210.c | 13 +------------
drivers/staging/iio/resolver/ad2s90.c | 13 +------------
include/linux/i2c.h | 13 +++++++++++++
include/linux/init.h | 21 +++++++++++++++++++++
include/linux/platform_device.h | 12 ++----------
include/linux/spi/spi.h | 11 +++++++++++
67 files changed, 110 insertions(+), 784 deletions(-)
--
1.7.7.1
next reply other threads:[~2011-11-16 9:13 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-16 9:13 Lars-Peter Clausen [this message]
2011-11-16 9:13 ` [PATCH 1/5] drivercore: Generalize module_platform_driver Lars-Peter Clausen
[not found] ` <1321434819-23678-2-git-send-email-lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2011-11-16 17:11 ` Grant Likely
[not found] ` <CACxGe6twCU9Nb+b00ei83jxaz0YnVa6nT0ra6Kp0c4PO7hjT6Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-17 6:51 ` Jonathan Cameron
2011-11-17 20:04 ` Greg KH
2012-01-13 9:07 ` Guennadi Liakhovetski
2012-01-13 18:23 ` Greg KH
2011-11-16 9:13 ` [PATCH 2/5] I2C: Add helper macro for i2c_driver boilerplate Lars-Peter Clausen
[not found] ` <1321434819-23678-3-git-send-email-lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2011-11-16 17:12 ` Grant Likely
[not found] ` <CACxGe6toOFjOdP7-oZ4O2J=g2U+Y+aWOUzHDoCaX6goAs6zKsQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-17 6:47 ` Jonathan Cameron
2011-11-16 9:13 ` [PATCH 3/5] SPI: Add helper macro for spi_driver boilerplate Lars-Peter Clausen
[not found] ` <1321434819-23678-4-git-send-email-lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2011-11-16 17:12 ` Grant Likely
[not found] ` <CACxGe6tz0ppZj=a_e4rkgNxzhQ4MSCtXKXGk_dPov80QDU4MCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-24 0:13 ` Ben Dooks
[not found] ` <20111124001342.GN19115-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>
2011-11-24 7:29 ` Lars-Peter Clausen
2011-11-16 9:13 ` [PATCH 4/5] staging:iio: Use module_i2c_driver to register I2C drivers Lars-Peter Clausen
[not found] ` <1321434819-23678-5-git-send-email-lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2011-11-17 6:50 ` Jonathan Cameron
[not found] ` <1321434819-23678-1-git-send-email-lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2011-11-16 9:13 ` [PATCH 5/5] staging:iio: Use module_spi_driver to register SPI driver Lars-Peter Clausen
2011-11-16 17:15 ` Grant Likely
[not found] ` <CACxGe6su+18Ct6E7z8VfbXcOwftxMm49A9Q49Eat8+StT17F4g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-17 6:48 ` Jonathan Cameron
[not found] ` <1321434819-23678-6-git-send-email-lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2011-11-17 6:49 ` Jonathan Cameron
2011-11-16 16:02 ` [PATCH 0/5] Generalize module_platform_driver Greg KH
2011-11-16 16:36 ` Jean Delvare
2011-11-16 16:37 ` Greg KH
[not found] ` <20111116163728.GA7196-l3A5Bk7waGM@public.gmane.org>
2011-11-16 17:13 ` Grant Likely
[not found] ` <CACxGe6sMJN6ZuF2E5vtbf-jquJRUPizzo_Ttdy1UkwtMO4axUA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-17 19:49 ` Greg KH
2011-11-16 20:14 ` Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1321434819-23678-1-git-send-email-lars@metafoo.de \
--to=lars-qo5elluwu/uelga04laivw@public.gmane.org \
--cc=Michael.Hennerich-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=gregkh-l3A5Bk7waGM@public.gmane.org \
--cc=jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).