diff options
Diffstat (limited to 'Documentation/i2c/writing-clients')
-rw-r--r-- | Documentation/i2c/writing-clients | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients index d19993cc0604..3a057c8e5507 100644 --- a/Documentation/i2c/writing-clients +++ b/Documentation/i2c/writing-clients | |||
@@ -25,9 +25,9 @@ routines, a client structure specific information like the actual I2C | |||
25 | address. | 25 | address. |
26 | 26 | ||
27 | static struct i2c_driver foo_driver = { | 27 | static struct i2c_driver foo_driver = { |
28 | .owner = THIS_MODULE, | 28 | .driver = { |
29 | .name = "Foo version 2.3 driver", | 29 | .name = "foo", |
30 | .flags = I2C_DF_NOTIFY, | 30 | }, |
31 | .attach_adapter = &foo_attach_adapter, | 31 | .attach_adapter = &foo_attach_adapter, |
32 | .detach_client = &foo_detach_client, | 32 | .detach_client = &foo_detach_client, |
33 | .command = &foo_command /* may be NULL */ | 33 | .command = &foo_command /* may be NULL */ |
@@ -36,10 +36,6 @@ static struct i2c_driver foo_driver = { | |||
36 | The name field must match the driver name, including the case. It must not | 36 | The name field must match the driver name, including the case. It must not |
37 | contain spaces, and may be up to 31 characters long. | 37 | contain spaces, and may be up to 31 characters long. |
38 | 38 | ||
39 | Don't worry about the flags field; just put I2C_DF_NOTIFY into it. This | ||
40 | means that your driver will be notified when new adapters are found. | ||
41 | This is almost always what you want. | ||
42 | |||
43 | All other fields are for call-back functions which will be explained | 39 | All other fields are for call-back functions which will be explained |
44 | below. | 40 | below. |
45 | 41 | ||
@@ -496,17 +492,13 @@ Note that some functions are marked by `__init', and some data structures | |||
496 | by `__init_data'. Hose functions and structures can be removed after | 492 | by `__init_data'. Hose functions and structures can be removed after |
497 | kernel booting (or module loading) is completed. | 493 | kernel booting (or module loading) is completed. |
498 | 494 | ||
495 | |||
499 | Command function | 496 | Command function |
500 | ================ | 497 | ================ |
501 | 498 | ||
502 | A generic ioctl-like function call back is supported. You will seldom | 499 | A generic ioctl-like function call back is supported. You will seldom |
503 | need this. You may even set it to NULL. | 500 | need this, and its use is deprecated anyway, so newer design should not |
504 | 501 | use it. Set it to NULL. | |
505 | /* No commands defined */ | ||
506 | int foo_command(struct i2c_client *client, unsigned int cmd, void *arg) | ||
507 | { | ||
508 | return 0; | ||
509 | } | ||
510 | 502 | ||
511 | 503 | ||
512 | Sending and receiving | 504 | Sending and receiving |