* [PATCH] i2c writing-clients document: mention module_i2c_driver()
@ 2012-01-18 13:00 Peter Meerwald
[not found] ` <1326891629-8495-1-git-send-email-pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Peter Meerwald @ 2012-01-18 13:00 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA; +Cc: lars-Qo5EllUWu/uELgA04lAiVw
From: Peter Meerwald <p.meerwald-12LT5diAjoA8TDmHOjzjNtBPR1lH4CV8@public.gmane.org>
---
Documentation/i2c/writing-clients | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients
index 5aa5337..71248b2 100644
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -266,6 +266,14 @@ be removed after kernel booting (or module loading) is completed.
Likewise, functions marked by `__exit' are dropped by the compiler when
the code is built into the kernel, as they would never be called.
+The module_i2c_driver() macro can be used to reduce above code.
+
+MODULE_AUTHOR("Frodo Looijaard <frodol-B0qZmFHriGg@public.gmane.org>"
+MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices");
+MODULE_LICENSE("GPL");
+
+module_i2c_driver(foo_driver);
+
Power Management
================
--
1.7.4.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c writing-clients document: mention module_i2c_driver()
[not found] ` <1326891629-8495-1-git-send-email-pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>
@ 2012-06-18 15:02 ` Jean Delvare
[not found] ` <20120618170236.21b04fd5-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Jean Delvare @ 2012-06-18 15:02 UTC (permalink / raw)
To: Peter Meerwald
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, lars-Qo5EllUWu/uELgA04lAiVw
Hi Peter,
Sorry for the late reply.
On Wed, 18 Jan 2012 14:00:29 +0100, Peter Meerwald wrote:
> From: Peter Meerwald <p.meerwald-12LT5diAjoA8TDmHOjzjNtBPR1lH4CV8@public.gmane.org>
Where's your Signed-off-by?
>
> ---
> Documentation/i2c/writing-clients | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients
> index 5aa5337..71248b2 100644
> --- a/Documentation/i2c/writing-clients
> +++ b/Documentation/i2c/writing-clients
> @@ -266,6 +266,14 @@ be removed after kernel booting (or module loading) is completed.
> Likewise, functions marked by `__exit' are dropped by the compiler when
> the code is built into the kernel, as they would never be called.
>
> +The module_i2c_driver() macro can be used to reduce above code.
> +
> +MODULE_AUTHOR("Frodo Looijaard <frodol-B0qZmFHriGg@public.gmane.org>"
> +MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices");
> +MODULE_LICENSE("GPL");
> +
> +module_i2c_driver(foo_driver);
> +
>
> Power Management
> ================
I agree this should be documented, but I would like to see it done
without repeating the MODULE_* macros. This can be done by moving these
to a separate section. What do you think?
Signed-off-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
---
Documentation/i2c/writing-clients | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
--- linux-3.5-rc3.orig/Documentation/i2c/writing-clients 2011-07-22 04:17:23.000000000 +0200
+++ linux-3.5-rc3/Documentation/i2c/writing-clients 2012-06-18 16:57:52.546924533 +0200
@@ -245,21 +245,17 @@ static int __init foo_init(void)
{
return i2c_add_driver(&foo_driver);
}
+module_init(foo_init);
static void __exit foo_cleanup(void)
{
i2c_del_driver(&foo_driver);
}
+module_exit(foo_cleanup);
-/* Substitute your own name and email address */
-MODULE_AUTHOR("Frodo Looijaard <frodol-B0qZmFHriGg@public.gmane.org>"
-MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices");
-
-/* a few non-GPL license types are also allowed */
-MODULE_LICENSE("GPL");
+The module_i2c_driver() macro can be used to reduce above code.
-module_init(foo_init);
-module_exit(foo_cleanup);
+module_i2c_driver(foo_driver);
Note that some functions are marked by `__init'. These functions can
be removed after kernel booting (or module loading) is completed.
@@ -267,6 +263,17 @@ Likewise, functions marked by `__exit' a
the code is built into the kernel, as they would never be called.
+Driver Information
+==================
+
+/* Substitute your own name and email address */
+MODULE_AUTHOR("Frodo Looijaard <frodol-B0qZmFHriGg@public.gmane.org>"
+MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices");
+
+/* a few non-GPL license types are also allowed */
+MODULE_LICENSE("GPL");
+
+
Power Management
================
--
Jean Delvare
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c writing-clients document: mention module_i2c_driver()
[not found] ` <20120618170236.21b04fd5-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
@ 2012-06-18 16:41 ` Peter Meerwald
0 siblings, 0 replies; 3+ messages in thread
From: Peter Meerwald @ 2012-06-18 16:41 UTC (permalink / raw)
To: Jean Delvare
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, lars-Qo5EllUWu/uELgA04lAiVw
Hello Jean,
> Where's your Signed-off-by?
thank you for taking and improving this patch, so
Acked-by: Peter Meerwald <p.meerwald-12LT5diAjoA8TDmHOjzjNtBPR1lH4CV8@public.gmane.org>
> > Documentation/i2c/writing-clients | 8 ++++++++
> > 1 files changed, 8 insertions(+), 0 deletions(-)
> >
> > diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients
> > index 5aa5337..71248b2 100644
> > --- a/Documentation/i2c/writing-clients
> > +++ b/Documentation/i2c/writing-clients
> > @@ -266,6 +266,14 @@ be removed after kernel booting (or module loading) is completed.
> > Likewise, functions marked by `__exit' are dropped by the compiler when
> > the code is built into the kernel, as they would never be called.
> >
> > +The module_i2c_driver() macro can be used to reduce above code.
> > +
> > +MODULE_AUTHOR("Frodo Looijaard <frodol-B0qZmFHriGg@public.gmane.org>"
> > +MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices");
> > +MODULE_LICENSE("GPL");
> > +
> > +module_i2c_driver(foo_driver);
> > +
> >
> > Power Management
> > ================
>
> I agree this should be documented, but I would like to see it done
> without repeating the MODULE_* macros. This can be done by moving these
> to a separate section. What do you think?
>
> Signed-off-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
> ---
> Documentation/i2c/writing-clients | 23 +++++++++++++++--------
> 1 file changed, 15 insertions(+), 8 deletions(-)
>
> --- linux-3.5-rc3.orig/Documentation/i2c/writing-clients 2011-07-22 04:17:23.000000000 +0200
> +++ linux-3.5-rc3/Documentation/i2c/writing-clients 2012-06-18 16:57:52.546924533 +0200
> @@ -245,21 +245,17 @@ static int __init foo_init(void)
> {
> return i2c_add_driver(&foo_driver);
> }
> +module_init(foo_init);
>
> static void __exit foo_cleanup(void)
> {
> i2c_del_driver(&foo_driver);
> }
> +module_exit(foo_cleanup);
>
> -/* Substitute your own name and email address */
> -MODULE_AUTHOR("Frodo Looijaard <frodol-B0qZmFHriGg@public.gmane.org>"
> -MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices");
> -
> -/* a few non-GPL license types are also allowed */
> -MODULE_LICENSE("GPL");
> +The module_i2c_driver() macro can be used to reduce above code.
>
> -module_init(foo_init);
> -module_exit(foo_cleanup);
> +module_i2c_driver(foo_driver);
>
> Note that some functions are marked by `__init'. These functions can
> be removed after kernel booting (or module loading) is completed.
> @@ -267,6 +263,17 @@ Likewise, functions marked by `__exit' a
> the code is built into the kernel, as they would never be called.
>
>
> +Driver Information
> +==================
> +
> +/* Substitute your own name and email address */
> +MODULE_AUTHOR("Frodo Looijaard <frodol-B0qZmFHriGg@public.gmane.org>"
> +MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices");
> +
> +/* a few non-GPL license types are also allowed */
> +MODULE_LICENSE("GPL");
> +
> +
> Power Management
> ================
>
>
>
>
>
--
Peter Meerwald
+43-664-2444418 (mobile)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-06-18 16:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-18 13:00 [PATCH] i2c writing-clients document: mention module_i2c_driver() Peter Meerwald
[not found] ` <1326891629-8495-1-git-send-email-pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>
2012-06-18 15:02 ` Jean Delvare
[not found] ` <20120618170236.21b04fd5-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-06-18 16:41 ` Peter Meerwald
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).