aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/tmp102.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/tmp102.c')
-rw-r--r--drivers/hwmon/tmp102.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/hwmon/tmp102.c b/drivers/hwmon/tmp102.c
index e9de28df0e4d..0da695d800c5 100644
--- a/drivers/hwmon/tmp102.c
+++ b/drivers/hwmon/tmp102.c
@@ -239,19 +239,27 @@ static int __devexit tmp102_remove(struct i2c_client *client)
239static int tmp102_suspend(struct device *dev) 239static int tmp102_suspend(struct device *dev)
240{ 240{
241 struct i2c_client *client = to_i2c_client(dev); 241 struct i2c_client *client = to_i2c_client(dev);
242 int config;
242 243
243 tmp102_write_reg(client, TMP102_CONF_REG, TMP102_CONF_SD); 244 config = tmp102_read_reg(client, TMP102_CONF_REG);
245 if (config < 0)
246 return config;
244 247
245 return 0; 248 config |= TMP102_CONF_SD;
249 return tmp102_write_reg(client, TMP102_CONF_REG, config);
246} 250}
247 251
248static int tmp102_resume(struct device *dev) 252static int tmp102_resume(struct device *dev)
249{ 253{
250 struct i2c_client *client = to_i2c_client(dev); 254 struct i2c_client *client = to_i2c_client(dev);
255 int config;
251 256
252 tmp102_write_reg(client, TMP102_CONF_REG, TMP102_CONFIG); 257 config = tmp102_read_reg(client, TMP102_CONF_REG);
258 if (config < 0)
259 return config;
253 260
254 return 0; 261 config &= ~TMP102_CONF_SD;
262 return tmp102_write_reg(client, TMP102_CONF_REG, config);
255} 263}
256 264
257static const struct dev_pm_ops tmp102_dev_pm_ops = { 265static const struct dev_pm_ops tmp102_dev_pm_ops = {