Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363213
b: refs/heads/master
c: 873bf4f
h: refs/heads/master
i:
  363211: 5c605f0
v: v3
  • Loading branch information
Lars-Peter Clausen authored and Greg Kroah-Hartman committed Apr 11, 2013
1 parent 9dc96e0 commit 3bc2f59
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 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: 5d4717d76f06d56586addcda59572113167e07da
refs/heads/master: 873bf4f46c7ab9b97da7458029e5e7b645578dfe
19 changes: 11 additions & 8 deletions trunk/drivers/misc/isl29003.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,18 +409,20 @@ static int isl29003_remove(struct i2c_client *client)
return 0;
}

#ifdef CONFIG_PM
static int isl29003_suspend(struct i2c_client *client, pm_message_t mesg)
#ifdef CONFIG_PM_SLEEP
static int isl29003_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct isl29003_data *data = i2c_get_clientdata(client);

data->power_state_before_suspend = isl29003_get_power_state(client);
return isl29003_set_power_state(client, 0);
}

static int isl29003_resume(struct i2c_client *client)
static int isl29003_resume(struct device *dev)
{
int i;
struct i2c_client *client = to_i2c_client(dev);
struct isl29003_data *data = i2c_get_clientdata(client);

/* restore registers from cache */
Expand All @@ -432,10 +434,12 @@ static int isl29003_resume(struct i2c_client *client)
data->power_state_before_suspend);
}

static SIMPLE_DEV_PM_OPS(isl29003_pm_ops, isl29003_suspend, isl29003_resume);
#define ISL29003_PM_OPS (&isl29003_pm_ops)

#else
#define isl29003_suspend NULL
#define isl29003_resume NULL
#endif /* CONFIG_PM */
#define ISL29003_PM_OPS NULL
#endif /* CONFIG_PM_SLEEP */

static const struct i2c_device_id isl29003_id[] = {
{ "isl29003", 0 },
Expand All @@ -447,9 +451,8 @@ static struct i2c_driver isl29003_driver = {
.driver = {
.name = ISL29003_DRV_NAME,
.owner = THIS_MODULE,
.pm = ISL29003_PM_OPS,
},
.suspend = isl29003_suspend,
.resume = isl29003_resume,
.probe = isl29003_probe,
.remove = isl29003_remove,
.id_table = isl29003_id,
Expand Down

0 comments on commit 3bc2f59

Please sign in to comment.