diff options
| -rw-r--r-- | Documentation/i2c/upgrading-clients | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Documentation/i2c/upgrading-clients b/Documentation/i2c/upgrading-clients index 9a45f9bb6a25..d6991625c407 100644 --- a/Documentation/i2c/upgrading-clients +++ b/Documentation/i2c/upgrading-clients | |||
| @@ -61,7 +61,7 @@ static int example_attach(struct i2c_adapter *adap, int addr, int kind) | |||
| 61 | return 0; | 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 | struct example_state *state = i2c_get_clientdata(client); | 66 | struct example_state *state = i2c_get_clientdata(client); |
| 67 | 67 | ||
| @@ -81,7 +81,7 @@ static struct i2c_driver example_driver = { | |||
| 81 | .name = "example", | 81 | .name = "example", |
| 82 | }, | 82 | }, |
| 83 | .attach_adapter = example_attach_adapter, | 83 | .attach_adapter = example_attach_adapter, |
| 84 | .detach_client = __devexit_p(example_detach), | 84 | .detach_client = example_detach, |
| 85 | .suspend = example_suspend, | 85 | .suspend = example_suspend, |
| 86 | .resume = example_resume, | 86 | .resume = example_resume, |
| 87 | }; | 87 | }; |
| @@ -93,7 +93,7 @@ Updating the client | |||
| 93 | The new style binding model will check against a list of supported | 93 | The new style binding model will check against a list of supported |
| 94 | devices and their associated address supplied by the code registering | 94 | devices and their associated address supplied by the code registering |
| 95 | the busses. This means that the driver .attach_adapter and | 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 | as follows: | 97 | as follows: |
| 98 | 98 | ||
| 99 | - static struct i2c_driver example_driver; | 99 | - static struct i2c_driver example_driver; |
| @@ -110,14 +110,14 @@ as follows: | |||
| 110 | 110 | ||
| 111 | static struct i2c_driver example_driver = { | 111 | static struct i2c_driver example_driver = { |
| 112 | - .attach_adapter = example_attach_adapter, | 112 | - .attach_adapter = example_attach_adapter, |
| 113 | - .detach_client = __devexit_p(example_detach), | 113 | - .detach_client = example_detach, |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | Add the probe and remove methods to the i2c_driver, as so: | 116 | Add the probe and remove methods to the i2c_driver, as so: |
| 117 | 117 | ||
| 118 | static struct i2c_driver example_driver = { | 118 | static struct i2c_driver example_driver = { |
| 119 | + .probe = example_probe, | 119 | + .probe = example_probe, |
| 120 | + .remove = __devexit_p(example_remove), | 120 | + .remove = example_remove, |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | Change the example_attach method to accept the new parameters | 123 | Change the example_attach method to accept the new parameters |
| @@ -199,8 +199,8 @@ to delete the i2c_detach_client call. It is possible that you | |||
| 199 | can also remove the ret variable as it is not not needed for | 199 | can also remove the ret variable as it is not not needed for |
| 200 | any of the core functions. | 200 | any of the core functions. |
| 201 | 201 | ||
| 202 | - static int __devexit example_detach(struct i2c_client *client) | 202 | - static int example_detach(struct i2c_client *client) |
| 203 | + static int __devexit example_remove(struct i2c_client *client) | 203 | + static int example_remove(struct i2c_client *client) |
| 204 | { | 204 | { |
| 205 | struct example_state *state = i2c_get_clientdata(client); | 205 | struct example_state *state = i2c_get_clientdata(client); |
| 206 | 206 | ||
| @@ -253,7 +253,7 @@ static int example_probe(struct i2c_client *client, | |||
| 253 | return 0; | 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 | struct example_state *state = i2c_get_clientdata(client); | 258 | struct example_state *state = i2c_get_clientdata(client); |
| 259 | 259 | ||
| @@ -275,7 +275,7 @@ static struct i2c_driver example_driver = { | |||
| 275 | }, | 275 | }, |
| 276 | .id_table = example_idtable, | 276 | .id_table = example_idtable, |
| 277 | .probe = example_probe, | 277 | .probe = example_probe, |
| 278 | .remove = __devexit_p(example_remove), | 278 | .remove = example_remove, |
| 279 | .suspend = example_suspend, | 279 | .suspend = example_suspend, |
| 280 | .resume = example_resume, | 280 | .resume = example_resume, |
| 281 | }; | 281 | }; |
