aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2012-07-24 08:13:57 -0400
committerJean Delvare <khali@endymion.delvare>2012-07-24 08:13:57 -0400
commit9cd3f2e8496ce97a9218d8b0ace06c4d8f0c6bf5 (patch)
treeab1eb7484deb0a304696f2cf7ace856a5b6716a3 /Documentation
parent2a2f7404a1946be62290292ca5d6438c4b50567f (diff)
i2c/writing-clients: Mention module_i2c_driver()
Based on a previous patch from Peter Meerwald. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/i2c/writing-clients23
1 files changed, 15 insertions, 8 deletions
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients
index 5aa53374ea2..3a94b0e6f60 100644
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -245,21 +245,17 @@ static int __init foo_init(void)
245{ 245{
246 return i2c_add_driver(&foo_driver); 246 return i2c_add_driver(&foo_driver);
247} 247}
248module_init(foo_init);
248 249
249static void __exit foo_cleanup(void) 250static void __exit foo_cleanup(void)
250{ 251{
251 i2c_del_driver(&foo_driver); 252 i2c_del_driver(&foo_driver);
252} 253}
254module_exit(foo_cleanup);
253 255
254/* Substitute your own name and email address */ 256The module_i2c_driver() macro can be used to reduce above code.
255MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>"
256MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices");
257
258/* a few non-GPL license types are also allowed */
259MODULE_LICENSE("GPL");
260 257
261module_init(foo_init); 258module_i2c_driver(foo_driver);
262module_exit(foo_cleanup);
263 259
264Note that some functions are marked by `__init'. These functions can 260Note that some functions are marked by `__init'. These functions can
265be removed after kernel booting (or module loading) is completed. 261be removed after kernel booting (or module loading) is completed.
@@ -267,6 +263,17 @@ Likewise, functions marked by `__exit' are dropped by the compiler when
267the code is built into the kernel, as they would never be called. 263the code is built into the kernel, as they would never be called.
268 264
269 265
266Driver Information
267==================
268
269/* Substitute your own name and email address */
270MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>"
271MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices");
272
273/* a few non-GPL license types are also allowed */
274MODULE_LICENSE("GPL");
275
276
270Power Management 277Power Management
271================ 278================
272 279