Commit ed065e26b8721553736ce9e38023488c6747e93d
Committed by
Jean Delvare
1 parent
d735b34db3
Exists in
master
and in
4 other branches
i2c: Minor fixes to upgrading-clients document
* Typical legacy drivers implemented method .detach_client, not .detach_adapter. * Drop all references to __devexit, as i2c drivers shouldn't use it. Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Showing 1 changed file with 9 additions and 9 deletions Side-by-side Diff
Documentation/i2c/upgrading-clients
| ... | ... | @@ -61,7 +61,7 @@ |
| 61 | 61 | return 0; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | -static int __devexit example_detach(struct i2c_client *client) | |
| 64 | +static int example_detach(struct i2c_client *client) | |
| 65 | 65 | { |
| 66 | 66 | struct example_state *state = i2c_get_clientdata(client); |
| 67 | 67 | |
| ... | ... | @@ -81,7 +81,7 @@ |
| 81 | 81 | .name = "example", |
| 82 | 82 | }, |
| 83 | 83 | .attach_adapter = example_attach_adapter, |
| 84 | - .detach_client = __devexit_p(example_detach), | |
| 84 | + .detach_client = example_detach, | |
| 85 | 85 | .suspend = example_suspend, |
| 86 | 86 | .resume = example_resume, |
| 87 | 87 | }; |
| ... | ... | @@ -93,7 +93,7 @@ |
| 93 | 93 | The new style binding model will check against a list of supported |
| 94 | 94 | devices and their associated address supplied by the code registering |
| 95 | 95 | the busses. This means that the driver .attach_adapter and |
| 96 | -.detach_adapter methods can be removed, along with the addr_data, | |
| 96 | +.detach_client methods can be removed, along with the addr_data, | |
| 97 | 97 | as follows: |
| 98 | 98 | |
| 99 | 99 | - static struct i2c_driver example_driver; |
| 100 | 100 | |
| ... | ... | @@ -110,14 +110,14 @@ |
| 110 | 110 | |
| 111 | 111 | static struct i2c_driver example_driver = { |
| 112 | 112 | - .attach_adapter = example_attach_adapter, |
| 113 | -- .detach_client = __devexit_p(example_detach), | |
| 113 | +- .detach_client = example_detach, | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | Add the probe and remove methods to the i2c_driver, as so: |
| 117 | 117 | |
| 118 | 118 | static struct i2c_driver example_driver = { |
| 119 | 119 | + .probe = example_probe, |
| 120 | -+ .remove = __devexit_p(example_remove), | |
| 120 | ++ .remove = example_remove, | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | Change the example_attach method to accept the new parameters |
| ... | ... | @@ -199,8 +199,8 @@ |
| 199 | 199 | can also remove the ret variable as it is not not needed for |
| 200 | 200 | any of the core functions. |
| 201 | 201 | |
| 202 | -- static int __devexit example_detach(struct i2c_client *client) | |
| 203 | -+ static int __devexit example_remove(struct i2c_client *client) | |
| 202 | +- static int example_detach(struct i2c_client *client) | |
| 203 | ++ static int example_remove(struct i2c_client *client) | |
| 204 | 204 | { |
| 205 | 205 | struct example_state *state = i2c_get_clientdata(client); |
| 206 | 206 | |
| ... | ... | @@ -253,7 +253,7 @@ |
| 253 | 253 | return 0; |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | -static int __devexit example_remove(struct i2c_client *client) | |
| 256 | +static int example_remove(struct i2c_client *client) | |
| 257 | 257 | { |
| 258 | 258 | struct example_state *state = i2c_get_clientdata(client); |
| 259 | 259 | |
| ... | ... | @@ -275,7 +275,7 @@ |
| 275 | 275 | }, |
| 276 | 276 | .id_table = example_idtable, |
| 277 | 277 | .probe = example_probe, |
| 278 | - .remove = __devexit_p(example_remove), | |
| 278 | + .remove = example_remove, | |
| 279 | 279 | .suspend = example_suspend, |
| 280 | 280 | .resume = example_resume, |
| 281 | 281 | }; |