summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrygorii Strashko <Grygorii.Strashko@linaro.org>2015-01-14 14:46:10 +0200
committerGrygorii Strashko <Grygorii.Strashko@linaro.org>2015-02-09 23:28:38 +0800
commit406aee00df46260c8359f8f231952c1d4582f383 (patch)
tree68cfb9822d76c453907b540d29f8b569ad314b31
parent545e7d6b3e27a62a45741b943cc090cd265252b6 (diff)
[hib-new-drv] rtc: rtc-ds1307: switch to use dev_pm_ops
Switch to use dev_pm_ops instead of legacy callbacks and avoid boot warnings: i2c-core: driver [rtc-ds1307] using legacy resume method Signed-off-by: Grygorii Strashko <Grygorii.Strashko@linaro.org>
-rw-r--r--drivers/rtc/rtc-ds1307.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index 5feedfc1095..1d2f55a6034 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -644,6 +644,7 @@ static void mcp7941x_work(struct work_struct *work)
goto out;
if (!(reg & MCP7941X_BIT_ALMX_IF))
goto out;
+
reg &= ~MCP7941X_BIT_ALMX_IF;
ret = i2c_smbus_write_byte_data(client, MCP7941X_REG_ALARM0_CTRL, reg);
if (ret < 0)
@@ -838,10 +839,10 @@ ds1307_nvram_write(struct file *filp, struct kobject *kobj,
/*----------------------------------------------------------------------*/
-static int ds1307_i2c_suspend(struct i2c_client *client, pm_message_t mesg)
+static int ds1307_i2c_suspend(struct device *dev)
{
+ struct i2c_client *client = to_i2c_client(dev);
struct ds1307 *ds1307 = i2c_get_clientdata(client);
- struct device *dev = &client->dev;
if (!ds1307->wakeirq)
return 0;
@@ -852,10 +853,10 @@ static int ds1307_i2c_suspend(struct i2c_client *client, pm_message_t mesg)
return 0;
}
-static int ds1307_i2c_resume(struct i2c_client *client)
+static int ds1307_i2c_resume(struct device *dev)
{
+ struct i2c_client *client = to_i2c_client(dev);
struct ds1307 *ds1307 = i2c_get_clientdata(client);
- struct device *dev = &client->dev;
if (!ds1307->wakeirq)
return 0;
@@ -1215,7 +1216,6 @@ read_rtc:
}
}
}
-
return 0;
exit:
@@ -1237,15 +1237,16 @@ static int ds1307_remove(struct i2c_client *client)
return 0;
}
+static SIMPLE_DEV_PM_OPS(ds1307_pm, ds1307_i2c_suspend, ds1307_i2c_resume);
+
static struct i2c_driver ds1307_driver = {
.driver = {
.name = "rtc-ds1307",
.owner = THIS_MODULE,
+ .pm = &ds1307_pm,
},
.probe = ds1307_probe,
.remove = ds1307_remove,
- .suspend = ds1307_i2c_suspend,
- .resume = ds1307_i2c_resume,
.id_table = ds1307_id,
};