Skip to content

Commit

Permalink
Merge tag 'pm-for-3.6-rc2' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/rafael/linux-pm

Pull power management fixes from Rafael J. Wysocki:

 - Fix for two recent regressions in the generic PM domains framework.

 - Revert of a commit that introduced a resume regression and is
   conceptually incorrect in my opinion.

 - Fix for a return value in pcc-cpufreq.c from Julia Lawall.

 - RTC wakeup signaling fix from Neil Brown.

 - Suppression of compiler warnings for CONFIG_PM_SLEEP unset in ACPI,
   platform/x86 and TPM drivers.

* tag 'pm-for-3.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  tpm_tis / PM: Fix unused function warning for CONFIG_PM_SLEEP
  platform / x86 / PM: Fix unused function warnings for CONFIG_PM_SLEEP
  ACPI / PM: Fix unused function warnings for CONFIG_PM_SLEEP
  Revert "NMI watchdog: fix for lockup detector breakage on resume"
  PM: Make dev_pm_get_subsys_data() always return 0 on success
  drivers/cpufreq/pcc-cpufreq.c: fix error return code
  RTC: Avoid races between RTC alarm wakeup and suspend.
  • Loading branch information
Linus Torvalds committed Aug 12, 2012
2 parents 88de3d0 + 07368d3 commit e4e139b
Show file tree
Hide file tree
Showing 27 changed files with 71 additions and 38 deletions.
4 changes: 4 additions & 0 deletions drivers/acpi/ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ static const struct acpi_device_id ac_device_ids[] = {
};
MODULE_DEVICE_TABLE(acpi, ac_device_ids);

#ifdef CONFIG_PM_SLEEP
static int acpi_ac_resume(struct device *dev);
#endif
static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume);

static struct acpi_driver acpi_ac_driver = {
Expand Down Expand Up @@ -313,6 +315,7 @@ static int acpi_ac_add(struct acpi_device *device)
return result;
}

#ifdef CONFIG_PM_SLEEP
static int acpi_ac_resume(struct device *dev)
{
struct acpi_ac *ac;
Expand All @@ -332,6 +335,7 @@ static int acpi_ac_resume(struct device *dev)
kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE);
return 0;
}
#endif

static int acpi_ac_remove(struct acpi_device *device, int type)
{
Expand Down
2 changes: 2 additions & 0 deletions drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
return 0;
}

#ifdef CONFIG_PM_SLEEP
/* this is needed to learn about changes made in suspended state */
static int acpi_battery_resume(struct device *dev)
{
Expand All @@ -1068,6 +1069,7 @@ static int acpi_battery_resume(struct device *dev)
acpi_battery_update(battery);
return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(acpi_battery_pm, NULL, acpi_battery_resume);

Expand Down
4 changes: 4 additions & 0 deletions drivers/acpi/button.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ static int acpi_button_add(struct acpi_device *device);
static int acpi_button_remove(struct acpi_device *device, int type);
static void acpi_button_notify(struct acpi_device *device, u32 event);

#ifdef CONFIG_PM_SLEEP
static int acpi_button_resume(struct device *dev);
#endif
static SIMPLE_DEV_PM_OPS(acpi_button_pm, NULL, acpi_button_resume);

static struct acpi_driver acpi_button_driver = {
Expand Down Expand Up @@ -310,6 +312,7 @@ static void acpi_button_notify(struct acpi_device *device, u32 event)
}
}

#ifdef CONFIG_PM_SLEEP
static int acpi_button_resume(struct device *dev)
{
struct acpi_device *device = to_acpi_device(dev);
Expand All @@ -319,6 +322,7 @@ static int acpi_button_resume(struct device *dev)
return acpi_lid_send_state(device);
return 0;
}
#endif

static int acpi_button_add(struct acpi_device *device)
{
Expand Down
4 changes: 4 additions & 0 deletions drivers/acpi/fan.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ static const struct acpi_device_id fan_device_ids[] = {
};
MODULE_DEVICE_TABLE(acpi, fan_device_ids);

#ifdef CONFIG_PM_SLEEP
static int acpi_fan_suspend(struct device *dev);
static int acpi_fan_resume(struct device *dev);
#endif
static SIMPLE_DEV_PM_OPS(acpi_fan_pm, acpi_fan_suspend, acpi_fan_resume);

static struct acpi_driver acpi_fan_driver = {
Expand Down Expand Up @@ -184,6 +186,7 @@ static int acpi_fan_remove(struct acpi_device *device, int type)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int acpi_fan_suspend(struct device *dev)
{
if (!dev)
Expand All @@ -207,6 +210,7 @@ static int acpi_fan_resume(struct device *dev)

return result;
}
#endif

static int __init acpi_fan_init(void)
{
Expand Down
4 changes: 4 additions & 0 deletions drivers/acpi/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ static const struct acpi_device_id power_device_ids[] = {
};
MODULE_DEVICE_TABLE(acpi, power_device_ids);

#ifdef CONFIG_PM_SLEEP
static int acpi_power_resume(struct device *dev);
#endif
static SIMPLE_DEV_PM_OPS(acpi_power_pm, NULL, acpi_power_resume);

static struct acpi_driver acpi_power_driver = {
Expand Down Expand Up @@ -775,6 +777,7 @@ static int acpi_power_remove(struct acpi_device *device, int type)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int acpi_power_resume(struct device *dev)
{
int result = 0, state;
Expand Down Expand Up @@ -803,6 +806,7 @@ static int acpi_power_resume(struct device *dev)

return result;
}
#endif

int __init acpi_power_init(void)
{
Expand Down
2 changes: 2 additions & 0 deletions drivers/acpi/sbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,7 @@ static void acpi_sbs_rmdirs(void)
#endif
}

#ifdef CONFIG_PM_SLEEP
static int acpi_sbs_resume(struct device *dev)
{
struct acpi_sbs *sbs;
Expand All @@ -997,6 +998,7 @@ static int acpi_sbs_resume(struct device *dev)
acpi_sbs_callback(sbs);
return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(acpi_sbs_pm, NULL, acpi_sbs_resume);

Expand Down
4 changes: 4 additions & 0 deletions drivers/acpi/thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ static const struct acpi_device_id thermal_device_ids[] = {
};
MODULE_DEVICE_TABLE(acpi, thermal_device_ids);

#ifdef CONFIG_PM_SLEEP
static int acpi_thermal_resume(struct device *dev);
#endif
static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, NULL, acpi_thermal_resume);

static struct acpi_driver acpi_thermal_driver = {
Expand Down Expand Up @@ -1041,6 +1043,7 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int acpi_thermal_resume(struct device *dev)
{
struct acpi_thermal *tz;
Expand Down Expand Up @@ -1075,6 +1078,7 @@ static int acpi_thermal_resume(struct device *dev)

return AE_OK;
}
#endif

static int thermal_act(const struct dmi_system_id *d) {

Expand Down
3 changes: 1 addition & 2 deletions drivers/base/power/clock_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ void pm_clk_init(struct device *dev)
*/
int pm_clk_create(struct device *dev)
{
int ret = dev_pm_get_subsys_data(dev);
return ret < 0 ? ret : 0;
return dev_pm_get_subsys_data(dev);
}

/**
Expand Down
4 changes: 1 addition & 3 deletions drivers/base/power/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
int dev_pm_get_subsys_data(struct device *dev)
{
struct pm_subsys_data *psd;
int ret = 0;

psd = kzalloc(sizeof(*psd), GFP_KERNEL);
if (!psd)
Expand All @@ -40,15 +39,14 @@ int dev_pm_get_subsys_data(struct device *dev)
dev->power.subsys_data = psd;
pm_clk_init(dev);
psd = NULL;
ret = 1;
}

spin_unlock_irq(&dev->power.lock);

/* kfree() verifies that its argument is nonzero. */
kfree(psd);

return ret;
return 0;
}
EXPORT_SYMBOL_GPL(dev_pm_get_subsys_data);

Expand Down
2 changes: 2 additions & 0 deletions drivers/char/tpm/tpm_tis.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,7 @@ module_param_string(hid, tpm_pnp_tbl[TIS_HID_USR_IDX].id,
MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe");
#endif

#ifdef CONFIG_PM_SLEEP
static int tpm_tis_resume(struct device *dev)
{
struct tpm_chip *chip = dev_get_drvdata(dev);
Expand All @@ -816,6 +817,7 @@ static int tpm_tis_resume(struct device *dev)

return tpm_pm_resume(dev);
}
#endif

static SIMPLE_DEV_PM_OPS(tpm_tis_pm, tpm_pm_suspend, tpm_tis_resume);

Expand Down
1 change: 1 addition & 0 deletions drivers/cpufreq/pcc-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ static int __init pcc_cpufreq_probe(void)
mem_resource->address_length);
if (pcch_virt_addr == NULL) {
pr_debug("probe: could not map shared mem region\n");
ret = -ENOMEM;
goto out_free;
}
pcch_hdr = pcch_virt_addr;
Expand Down
4 changes: 4 additions & 0 deletions drivers/platform/x86/classmate-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ static void cmpc_accel_idev_init_v4(struct input_dev *inputdev)
inputdev->close = cmpc_accel_close_v4;
}

#ifdef CONFIG_PM_SLEEP
static int cmpc_accel_suspend_v4(struct device *dev)
{
struct input_dev *inputdev;
Expand Down Expand Up @@ -384,6 +385,7 @@ static int cmpc_accel_resume_v4(struct device *dev)

return 0;
}
#endif

static int cmpc_accel_add_v4(struct acpi_device *acpi)
{
Expand Down Expand Up @@ -752,6 +754,7 @@ static int cmpc_tablet_remove(struct acpi_device *acpi, int type)
return cmpc_remove_acpi_notify_device(acpi);
}

#ifdef CONFIG_PM_SLEEP
static int cmpc_tablet_resume(struct device *dev)
{
struct input_dev *inputdev = dev_get_drvdata(dev);
Expand All @@ -761,6 +764,7 @@ static int cmpc_tablet_resume(struct device *dev)
input_report_switch(inputdev, SW_TABLET_MODE, !val);
return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(cmpc_tablet_pm, NULL, cmpc_tablet_resume);

Expand Down
2 changes: 2 additions & 0 deletions drivers/platform/x86/fujitsu-tablet.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,11 +440,13 @@ static int __devexit acpi_fujitsu_remove(struct acpi_device *adev, int type)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int acpi_fujitsu_resume(struct device *dev)
{
fujitsu_reset();
return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(acpi_fujitsu_pm, NULL, acpi_fujitsu_resume);

Expand Down
2 changes: 2 additions & 0 deletions drivers/platform/x86/hdaps.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,12 @@ static int hdaps_probe(struct platform_device *dev)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int hdaps_resume(struct device *dev)
{
return hdaps_device_init();
}
#endif

static SIMPLE_DEV_PM_OPS(hdaps_pm, NULL, hdaps_resume);

Expand Down
2 changes: 1 addition & 1 deletion drivers/platform/x86/hp_accel.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ static int lis3lv02d_remove(struct acpi_device *device, int type)
}


#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
static int lis3lv02d_suspend(struct device *dev)
{
/* make sure the device is off when we suspend */
Expand Down
4 changes: 4 additions & 0 deletions drivers/platform/x86/msi-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
#define MSI_STANDARD_EC_TOUCHPAD_ADDRESS 0xe4
#define MSI_STANDARD_EC_TOUCHPAD_MASK (1 << 4)

#ifdef CONFIG_PM_SLEEP
static int msi_laptop_resume(struct device *device);
#endif
static SIMPLE_DEV_PM_OPS(msi_laptop_pm, NULL, msi_laptop_resume);

#define MSI_STANDARD_EC_DEVICES_EXISTS_ADDRESS 0x2f
Expand Down Expand Up @@ -753,6 +755,7 @@ static int rfkill_init(struct platform_device *sdev)
return retval;
}

#ifdef CONFIG_PM_SLEEP
static int msi_laptop_resume(struct device *device)
{
u8 data;
Expand All @@ -773,6 +776,7 @@ static int msi_laptop_resume(struct device *device)

return 0;
}
#endif

static int __init msi_laptop_input_setup(void)
{
Expand Down
4 changes: 4 additions & 0 deletions drivers/platform/x86/panasonic-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ static const struct acpi_device_id pcc_device_ids[] = {
};
MODULE_DEVICE_TABLE(acpi, pcc_device_ids);

#ifdef CONFIG_PM_SLEEP
static int acpi_pcc_hotkey_resume(struct device *dev);
#endif
static SIMPLE_DEV_PM_OPS(acpi_pcc_hotkey_pm, NULL, acpi_pcc_hotkey_resume);

static struct acpi_driver acpi_pcc_driver = {
Expand Down Expand Up @@ -540,6 +542,7 @@ static void acpi_pcc_destroy_input(struct pcc_acpi *pcc)

/* kernel module interface */

#ifdef CONFIG_PM_SLEEP
static int acpi_pcc_hotkey_resume(struct device *dev)
{
struct pcc_acpi *pcc;
Expand All @@ -556,6 +559,7 @@ static int acpi_pcc_hotkey_resume(struct device *dev)

return acpi_pcc_write_sset(pcc, SINF_STICKY_KEY, pcc->sticky_mode);
}
#endif

static int acpi_pcc_hotkey_add(struct acpi_device *device)
{
Expand Down
Loading

0 comments on commit e4e139b

Please sign in to comment.