diff options
author | Jean Delvare <khali@linux-fr.org> | 2012-07-24 08:13:57 -0400 |
---|---|---|
committer | Jean Delvare <khali@endymion.delvare> | 2012-07-24 08:13:57 -0400 |
commit | 9cd3f2e8496ce97a9218d8b0ace06c4d8f0c6bf5 (patch) | |
tree | ab1eb7484deb0a304696f2cf7ace856a5b6716a3 /Documentation/i2c | |
parent | 2a2f7404a1946be62290292ca5d6438c4b50567f (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/i2c')
-rw-r--r-- | Documentation/i2c/writing-clients | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients index 5aa53374ea2a..3a94b0e6f601 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 | } |
248 | module_init(foo_init); | ||
248 | 249 | ||
249 | static void __exit foo_cleanup(void) | 250 | static void __exit foo_cleanup(void) |
250 | { | 251 | { |
251 | i2c_del_driver(&foo_driver); | 252 | i2c_del_driver(&foo_driver); |
252 | } | 253 | } |
254 | module_exit(foo_cleanup); | ||
253 | 255 | ||
254 | /* Substitute your own name and email address */ | 256 | The module_i2c_driver() macro can be used to reduce above code. |
255 | MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>" | ||
256 | MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices"); | ||
257 | |||
258 | /* a few non-GPL license types are also allowed */ | ||
259 | MODULE_LICENSE("GPL"); | ||
260 | 257 | ||
261 | module_init(foo_init); | 258 | module_i2c_driver(foo_driver); |
262 | module_exit(foo_cleanup); | ||
263 | 259 | ||
264 | Note that some functions are marked by `__init'. These functions can | 260 | Note that some functions are marked by `__init'. These functions can |
265 | be removed after kernel booting (or module loading) is completed. | 261 | be removed after kernel booting (or module loading) is completed. |
@@ -267,6 +263,17 @@ Likewise, functions marked by `__exit' are dropped by the compiler when | |||
267 | the code is built into the kernel, as they would never be called. | 263 | the code is built into the kernel, as they would never be called. |
268 | 264 | ||
269 | 265 | ||
266 | Driver Information | ||
267 | ================== | ||
268 | |||
269 | /* Substitute your own name and email address */ | ||
270 | MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>" | ||
271 | MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices"); | ||
272 | |||
273 | /* a few non-GPL license types are also allowed */ | ||
274 | MODULE_LICENSE("GPL"); | ||
275 | |||
276 | |||
270 | Power Management | 277 | Power Management |
271 | ================ | 278 | ================ |
272 | 279 | ||