diff options
author | Patrick McHardy <kaber@trash.net> | 2011-04-13 07:32:28 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2011-04-13 07:32:28 -0400 |
commit | b32e3dc7860d00124fa432dba09667e647cb9bcc (patch) | |
tree | 2fa6e56f389431dfb84609d3d7572cad76e88e71 /drivers/misc/apds9802als.c | |
parent | 6604271c5bc658a6067ed0c3deba4d89e0e50382 (diff) | |
parent | 96120d86fe302c006259baee9061eea9e1b9e486 (diff) |
Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6
Diffstat (limited to 'drivers/misc/apds9802als.c')
-rw-r--r-- | drivers/misc/apds9802als.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c index 644d4cd071cc..81db7811cf68 100644 --- a/drivers/misc/apds9802als.c +++ b/drivers/misc/apds9802als.c | |||
@@ -245,9 +245,8 @@ static int apds9802als_probe(struct i2c_client *client, | |||
245 | als_set_default_config(client); | 245 | als_set_default_config(client); |
246 | mutex_init(&data->mutex); | 246 | mutex_init(&data->mutex); |
247 | 247 | ||
248 | pm_runtime_set_active(&client->dev); | ||
248 | pm_runtime_enable(&client->dev); | 249 | pm_runtime_enable(&client->dev); |
249 | pm_runtime_get(&client->dev); | ||
250 | pm_runtime_put(&client->dev); | ||
251 | 250 | ||
252 | return res; | 251 | return res; |
253 | als_error1: | 252 | als_error1: |
@@ -255,12 +254,19 @@ als_error1: | |||
255 | return res; | 254 | return res; |
256 | } | 255 | } |
257 | 256 | ||
258 | static int apds9802als_remove(struct i2c_client *client) | 257 | static int __devexit apds9802als_remove(struct i2c_client *client) |
259 | { | 258 | { |
260 | struct als_data *data = i2c_get_clientdata(client); | 259 | struct als_data *data = i2c_get_clientdata(client); |
261 | 260 | ||
261 | pm_runtime_get_sync(&client->dev); | ||
262 | |||
262 | als_set_power_state(client, false); | 263 | als_set_power_state(client, false); |
263 | sysfs_remove_group(&client->dev.kobj, &m_als_gr); | 264 | sysfs_remove_group(&client->dev.kobj, &m_als_gr); |
265 | |||
266 | pm_runtime_disable(&client->dev); | ||
267 | pm_runtime_set_suspended(&client->dev); | ||
268 | pm_runtime_put_noidle(&client->dev); | ||
269 | |||
264 | kfree(data); | 270 | kfree(data); |
265 | return 0; | 271 | return 0; |
266 | } | 272 | } |
@@ -275,9 +281,6 @@ static int apds9802als_suspend(struct i2c_client *client, pm_message_t mesg) | |||
275 | static int apds9802als_resume(struct i2c_client *client) | 281 | static int apds9802als_resume(struct i2c_client *client) |
276 | { | 282 | { |
277 | als_set_default_config(client); | 283 | als_set_default_config(client); |
278 | |||
279 | pm_runtime_get(&client->dev); | ||
280 | pm_runtime_put(&client->dev); | ||
281 | return 0; | 284 | return 0; |
282 | } | 285 | } |
283 | 286 | ||
@@ -323,7 +326,7 @@ static struct i2c_driver apds9802als_driver = { | |||
323 | .pm = APDS9802ALS_PM_OPS, | 326 | .pm = APDS9802ALS_PM_OPS, |
324 | }, | 327 | }, |
325 | .probe = apds9802als_probe, | 328 | .probe = apds9802als_probe, |
326 | .remove = apds9802als_remove, | 329 | .remove = __devexit_p(apds9802als_remove), |
327 | .suspend = apds9802als_suspend, | 330 | .suspend = apds9802als_suspend, |
328 | .resume = apds9802als_resume, | 331 | .resume = apds9802als_resume, |
329 | .id_table = apds9802als_id, | 332 | .id_table = apds9802als_id, |