diff options
Diffstat (limited to 'drivers/hwmon/tmp102.c')
| -rw-r--r-- | drivers/hwmon/tmp102.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/hwmon/tmp102.c b/drivers/hwmon/tmp102.c index ba9f478f64ee..9da2735f1424 100644 --- a/drivers/hwmon/tmp102.c +++ b/drivers/hwmon/tmp102.c | |||
| @@ -253,7 +253,7 @@ static int tmp102_remove(struct i2c_client *client) | |||
| 253 | return 0; | 253 | return 0; |
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | #ifdef CONFIG_PM | 256 | #ifdef CONFIG_PM_SLEEP |
| 257 | static int tmp102_suspend(struct device *dev) | 257 | static int tmp102_suspend(struct device *dev) |
| 258 | { | 258 | { |
| 259 | struct i2c_client *client = to_i2c_client(dev); | 259 | struct i2c_client *client = to_i2c_client(dev); |
| @@ -279,17 +279,10 @@ static int tmp102_resume(struct device *dev) | |||
| 279 | config &= ~TMP102_CONF_SD; | 279 | config &= ~TMP102_CONF_SD; |
| 280 | return i2c_smbus_write_word_swapped(client, TMP102_CONF_REG, config); | 280 | return i2c_smbus_write_word_swapped(client, TMP102_CONF_REG, config); |
| 281 | } | 281 | } |
| 282 | |||
| 283 | static const struct dev_pm_ops tmp102_dev_pm_ops = { | ||
| 284 | .suspend = tmp102_suspend, | ||
| 285 | .resume = tmp102_resume, | ||
| 286 | }; | ||
| 287 | |||
| 288 | #define TMP102_DEV_PM_OPS (&tmp102_dev_pm_ops) | ||
| 289 | #else | ||
| 290 | #define TMP102_DEV_PM_OPS NULL | ||
| 291 | #endif /* CONFIG_PM */ | 282 | #endif /* CONFIG_PM */ |
| 292 | 283 | ||
| 284 | static SIMPLE_DEV_PM_OPS(tmp102_dev_pm_ops, tmp102_suspend, tmp102_resume); | ||
| 285 | |||
| 293 | static const struct i2c_device_id tmp102_id[] = { | 286 | static const struct i2c_device_id tmp102_id[] = { |
| 294 | { "tmp102", 0 }, | 287 | { "tmp102", 0 }, |
| 295 | { } | 288 | { } |
| @@ -298,7 +291,7 @@ MODULE_DEVICE_TABLE(i2c, tmp102_id); | |||
| 298 | 291 | ||
| 299 | static struct i2c_driver tmp102_driver = { | 292 | static struct i2c_driver tmp102_driver = { |
| 300 | .driver.name = DRIVER_NAME, | 293 | .driver.name = DRIVER_NAME, |
| 301 | .driver.pm = TMP102_DEV_PM_OPS, | 294 | .driver.pm = &tmp102_dev_pm_ops, |
| 302 | .probe = tmp102_probe, | 295 | .probe = tmp102_probe, |
| 303 | .remove = tmp102_remove, | 296 | .remove = tmp102_remove, |
| 304 | .id_table = tmp102_id, | 297 | .id_table = tmp102_id, |
