aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-06-27 17:19:45 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-07-01 07:31:14 -0400
commit8ff847fc21e53be0e2ebd476ce6269a201575152 (patch)
tree88553125754ca851afa259cab032c88ff4d699aa /drivers/platform
parent3c33be0b0dae390557f41a604ac621d0f3eabf9b (diff)
intel_mid_thermal: Use struct dev_pm_ops for power management
Make the intel_mid_thermal driver define its PM callbacks through a struct dev_pm_ops object rather than by using legacy PM hooks in struct platform_driver. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Reviewed-by: Durgadoss R <durgadoss.r@intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/intel_mid_thermal.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/platform/x86/intel_mid_thermal.c b/drivers/platform/x86/intel_mid_thermal.c
index 5ae9cd9c7e6e..ea7422f6fa03 100644
--- a/drivers/platform/x86/intel_mid_thermal.c
+++ b/drivers/platform/x86/intel_mid_thermal.c
@@ -418,23 +418,23 @@ static struct thermal_device_info *initialize_sensor(int index)
418 418
419/** 419/**
420 * mid_thermal_resume - resume routine 420 * mid_thermal_resume - resume routine
421 * @pdev: platform device structure 421 * @dev: device structure
422 * 422 *
423 * mid thermal resume: re-initializes the adc. Can sleep. 423 * mid thermal resume: re-initializes the adc. Can sleep.
424 */ 424 */
425static int mid_thermal_resume(struct platform_device *pdev) 425static int mid_thermal_resume(struct device *dev)
426{ 426{
427 return mid_initialize_adc(&pdev->dev); 427 return mid_initialize_adc(dev);
428} 428}
429 429
430/** 430/**
431 * mid_thermal_suspend - suspend routine 431 * mid_thermal_suspend - suspend routine
432 * @pdev: platform device structure 432 * @dev: device structure
433 * 433 *
434 * mid thermal suspend implements the suspend functionality 434 * mid thermal suspend implements the suspend functionality
435 * by stopping the ADC. Can sleep. 435 * by stopping the ADC. Can sleep.
436 */ 436 */
437static int mid_thermal_suspend(struct platform_device *pdev, pm_message_t mesg) 437static int mid_thermal_suspend(struct device *dev)
438{ 438{
439 /* 439 /*
440 * This just stops the ADC and does not disable it. 440 * This just stops the ADC and does not disable it.
@@ -444,6 +444,9 @@ static int mid_thermal_suspend(struct platform_device *pdev, pm_message_t mesg)
444 return configure_adc(0); 444 return configure_adc(0);
445} 445}
446 446
447static SIMPLE_DEV_PM_OPS(mid_thermal_pm,
448 mid_thermal_suspend, mid_thermal_resume);
449
447/** 450/**
448 * read_curr_temp - reads the current temperature and stores in temp 451 * read_curr_temp - reads the current temperature and stores in temp
449 * @temp: holds the current temperature value after reading 452 * @temp: holds the current temperature value after reading
@@ -557,10 +560,9 @@ static struct platform_driver mid_thermal_driver = {
557 .driver = { 560 .driver = {
558 .name = DRIVER_NAME, 561 .name = DRIVER_NAME,
559 .owner = THIS_MODULE, 562 .owner = THIS_MODULE,
563 .pm = &mid_thermal_pm,
560 }, 564 },
561 .probe = mid_thermal_probe, 565 .probe = mid_thermal_probe,
562 .suspend = mid_thermal_suspend,
563 .resume = mid_thermal_resume,
564 .remove = __devexit_p(mid_thermal_remove), 566 .remove = __devexit_p(mid_thermal_remove),
565 .id_table = therm_id_table, 567 .id_table = therm_id_table,
566}; 568};