Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 367504
b: refs/heads/master
c: cc6616f
h: refs/heads/master
v: v3
  • Loading branch information
Lars-Peter Clausen authored and Anton Vorontsov committed Apr 1, 2013
1 parent ac9931b commit 26f2107
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 075ed03ce6c2cd148b4606619e775c6e46aa89e1
refs/heads/master: cc6616f6902fe96287585664cbad082d0c431206
23 changes: 11 additions & 12 deletions trunk/drivers/power/ds2782_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,32 +332,32 @@ static int ds278x_battery_remove(struct i2c_client *client)
return 0;
}

#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP

static int ds278x_suspend(struct i2c_client *client,
pm_message_t state)
static int ds278x_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct ds278x_info *info = i2c_get_clientdata(client);

cancel_delayed_work(&info->bat_work);
return 0;
}

static int ds278x_resume(struct i2c_client *client)
static int ds278x_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct ds278x_info *info = i2c_get_clientdata(client);

schedule_delayed_work(&info->bat_work, DS278x_DELAY);
return 0;
}

#else

#define ds278x_suspend NULL
#define ds278x_resume NULL

#endif /* CONFIG_PM */
static SIMPLE_DEV_PM_OPS(ds278x_battery_pm_ops, ds278x_suspend, ds278x_resume);
#define DS278X_BATTERY_PM_OPS (&ds278x_battery_pm_ops)

#else
#define DS278X_BATTERY_PM_OPS NULL
#endif /* CONFIG_PM_SLEEP */

enum ds278x_num_id {
DS2782 = 0,
Expand Down Expand Up @@ -460,11 +460,10 @@ MODULE_DEVICE_TABLE(i2c, ds278x_id);
static struct i2c_driver ds278x_battery_driver = {
.driver = {
.name = "ds2782-battery",
.pm = DS278X_BATTERY_PM_OPS,
},
.probe = ds278x_battery_probe,
.remove = ds278x_battery_remove,
.suspend = ds278x_suspend,
.resume = ds278x_resume,
.id_table = ds278x_id,
};
module_i2c_driver(ds278x_battery_driver);
Expand Down

0 comments on commit 26f2107

Please sign in to comment.