aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/i2c/writing-clients
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /Documentation/i2c/writing-clients
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'Documentation/i2c/writing-clients')
-rw-r--r--Documentation/i2c/writing-clients23
1 files changed, 8 insertions, 15 deletions
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients
index 3a94b0e6f60..5aa53374ea2 100644
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -245,26 +245,11 @@ 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);
249 248
250static void __exit foo_cleanup(void) 249static void __exit foo_cleanup(void)
251{ 250{
252 i2c_del_driver(&foo_driver); 251 i2c_del_driver(&foo_driver);
253} 252}
254module_exit(foo_cleanup);
255
256The module_i2c_driver() macro can be used to reduce above code.
257
258module_i2c_driver(foo_driver);
259
260Note that some functions are marked by `__init'. These functions can
261be removed after kernel booting (or module loading) is completed.
262Likewise, functions marked by `__exit' are dropped by the compiler when
263the code is built into the kernel, as they would never be called.
264
265
266Driver Information
267==================
268 253
269/* Substitute your own name and email address */ 254/* Substitute your own name and email address */
270MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>" 255MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>"
@@ -273,6 +258,14 @@ MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices");
273/* a few non-GPL license types are also allowed */ 258/* a few non-GPL license types are also allowed */
274MODULE_LICENSE("GPL"); 259MODULE_LICENSE("GPL");
275 260
261module_init(foo_init);
262module_exit(foo_cleanup);
263
264Note that some functions are marked by `__init'. These functions can
265be removed after kernel booting (or module loading) is completed.
266Likewise, functions marked by `__exit' are dropped by the compiler when
267the code is built into the kernel, as they would never be called.
268
276 269
277Power Management 270Power Management
278================ 271================