linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
	Jean Delvare <khali@linux-fr.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-i2c@vger.kernel.org,
	spi-devel-general@lists.sourceforge.net
Subject: Re: [PATCH 2/5] I2C: Add helper macro for i2c_driver boilerplate
Date: Wed, 16 Nov 2011 10:12:20 -0700	[thread overview]
Message-ID: <CACxGe6toOFjOdP7-oZ4O2J=g2U+Y+aWOUzHDoCaX6goAs6zKsQ@mail.gmail.com> (raw)
In-Reply-To: <1321434819-23678-3-git-send-email-lars@metafoo.de>

On Wed, Nov 16, 2011 at 2:13 AM, Lars-Peter Clausen <lars@metafoo.de> wrote=
:
> This patch introduces the module_i2c_driver macro which is a convenience =
macro
> for I2C driver modules similar to module_platform_driver. It is intended =
to be
> used by drivers which init/exit section does nothing but register/unregis=
ter
> the I2C driver. By using this macro it is possible to eliminate a few lin=
es of
> boilerplate code per I2C driver.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

Acked-by: Grant Likely <grant.likely@secretlab.ca>

> ---
> =A0include/linux/i2c.h | =A0 13 +++++++++++++
> =A01 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/i2c.h b/include/linux/i2c.h
> index a81bf6d..7e92854 100644
> --- a/include/linux/i2c.h
> +++ b/include/linux/i2c.h
> @@ -485,6 +485,19 @@ static inline int i2c_adapter_id(struct i2c_adapter =
*adap)
> =A0{
> =A0 =A0 =A0 =A0return adap->nr;
> =A0}
> +
> +/**
> + * module_i2c_driver() - Helper macro for registering a I2C driver
> + * @__i2c_driver: i2c_driver struct
> + *
> + * Helper macro for I2C drivers which do not do anything special in modu=
le
> + * init/exit. This eliminates a lot of boilerplate. Each module may only
> + * use this macro once, and calling it replaces module_init() and module=
_exit()
> + */
> +#define module_i2c_driver(__i2c_driver) \
> + =A0 =A0 =A0 module_driver(__i2c_driver, i2c_add_driver, \
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 i2c_del_driver)
> +
> =A0#endif /* I2C */
> =A0#endif /* __KERNEL__ */
>
> --
> 1.7.7.1
>
>
>



--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

  reply	other threads:[~2011-11-16 17:12 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-16  9:13 [PATCH 0/5] Generalize module_platform_driver Lars-Peter Clausen
2011-11-16  9:13 ` [PATCH 1/5] drivercore: " Lars-Peter Clausen
2011-11-16 17:11   ` Grant Likely
2011-11-17  6:51     ` Jonathan Cameron
2011-11-17 20:04   ` Greg KH
2012-01-13  9:07   ` Guennadi Liakhovetski
2011-11-16  9:13 ` [PATCH 2/5] I2C: Add helper macro for i2c_driver boilerplate Lars-Peter Clausen
2011-11-16 17:12   ` Grant Likely [this message]
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
2011-11-16 17:12   ` Grant Likely
2011-11-24  0:13     ` Ben Dooks
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
2011-11-17  6:50   ` Jonathan Cameron
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
2011-11-17  6:48     ` Jonathan Cameron
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
2011-11-16 17:13       ` Grant Likely
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='CACxGe6toOFjOdP7-oZ4O2J=g2U+Y+aWOUzHDoCaX6goAs6zKsQ@mail.gmail.com' \
    --to=grant.likely@secretlab.ca \
    --cc=Michael.Hennerich@analog.com \
    --cc=gregkh@suse.de \
    --cc=jic23@kernel.org \
    --cc=khali@linux-fr.org \
    --cc=lars@metafoo.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    /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).