diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
| commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
| tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /Documentation/i2c/writing-clients | |
| parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) | |
Patched in Tegra support.
Diffstat (limited to 'Documentation/i2c/writing-clients')
| -rw-r--r-- | Documentation/i2c/writing-clients | 23 |
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 | } |
| 248 | module_init(foo_init); | ||
| 249 | 248 | ||
| 250 | static void __exit foo_cleanup(void) | 249 | static void __exit foo_cleanup(void) |
| 251 | { | 250 | { |
| 252 | i2c_del_driver(&foo_driver); | 251 | i2c_del_driver(&foo_driver); |
| 253 | } | 252 | } |
| 254 | module_exit(foo_cleanup); | ||
| 255 | |||
| 256 | The module_i2c_driver() macro can be used to reduce above code. | ||
| 257 | |||
| 258 | module_i2c_driver(foo_driver); | ||
| 259 | |||
| 260 | Note that some functions are marked by `__init'. These functions can | ||
| 261 | be removed after kernel booting (or module loading) is completed. | ||
| 262 | Likewise, functions marked by `__exit' are dropped by the compiler when | ||
| 263 | the code is built into the kernel, as they would never be called. | ||
| 264 | |||
| 265 | |||
| 266 | Driver Information | ||
| 267 | ================== | ||
| 268 | 253 | ||
| 269 | /* Substitute your own name and email address */ | 254 | /* Substitute your own name and email address */ |
| 270 | MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>" | 255 | MODULE_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 */ |
| 274 | MODULE_LICENSE("GPL"); | 259 | MODULE_LICENSE("GPL"); |
| 275 | 260 | ||
| 261 | module_init(foo_init); | ||
| 262 | module_exit(foo_cleanup); | ||
| 263 | |||
| 264 | Note that some functions are marked by `__init'. These functions can | ||
| 265 | be removed after kernel booting (or module loading) is completed. | ||
| 266 | 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. | ||
| 268 | |||
| 276 | 269 | ||
| 277 | Power Management | 270 | Power Management |
| 278 | ================ | 271 | ================ |
