Skip to content

Commit

Permalink
Merge branches 'pm-sleep' and 'powercap'
Browse files Browse the repository at this point in the history
* pm-sleep:
  PM / hibernate: Declare variables as static
  RTC: rtc-cmos: Fix wakeup from suspend-to-idle
  PM / wakeup: Fix up wakeup_source_report_event()

* powercap:
  PowerCap: Fix an error code in powercap_register_zone()
  • Loading branch information
Rafael J. Wysocki committed May 22, 2017
3 parents 079c181 + 0bae5fd + 216c4e9 commit bb47e96
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
11 changes: 5 additions & 6 deletions drivers/base/power/wakeup.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,23 +512,19 @@ static bool wakeup_source_not_registered(struct wakeup_source *ws)
/**
* wakup_source_activate - Mark given wakeup source as active.
* @ws: Wakeup source to handle.
* @hard: If set, abort suspends in progress and wake up from suspend-to-idle.
*
* Update the @ws' statistics and, if @ws has just been activated, notify the PM
* core of the event by incrementing the counter of of wakeup events being
* processed.
*/
static void wakeup_source_activate(struct wakeup_source *ws, bool hard)
static void wakeup_source_activate(struct wakeup_source *ws)
{
unsigned int cec;

if (WARN_ONCE(wakeup_source_not_registered(ws),
"unregistered wakeup source\n"))
return;

if (hard)
pm_system_wakeup();

ws->active = true;
ws->active_count++;
ws->last_time = ktime_get();
Expand All @@ -554,7 +550,10 @@ static void wakeup_source_report_event(struct wakeup_source *ws, bool hard)
ws->wakeup_count++;

if (!ws->active)
wakeup_source_activate(ws, hard);
wakeup_source_activate(ws);

if (hard)
pm_system_wakeup();
}

/**
Expand Down
1 change: 1 addition & 0 deletions drivers/powercap/powercap_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ struct powercap_zone *powercap_register_zone(

power_zone->id = result;
idr_init(&power_zone->idr);
result = -ENOMEM;
power_zone->name = kstrdup(name, GFP_KERNEL);
if (!power_zone->name)
goto err_name_alloc;
Expand Down
2 changes: 1 addition & 1 deletion drivers/rtc/rtc-cmos.c
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ static u32 rtc_handler(void *context)
}
spin_unlock_irqrestore(&rtc_lock, flags);

pm_wakeup_event(dev, 0);
pm_wakeup_hard_event(dev);
acpi_clear_event(ACPI_EVENT_RTC);
acpi_disable_event(ACPI_EVENT_RTC, 0);
return ACPI_INTERRUPT_HANDLED;
Expand Down
2 changes: 1 addition & 1 deletion kernel/power/snapshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ static unsigned int nr_meta_pages;
* Numbers of normal and highmem page frames allocated for hibernation image
* before suspending devices.
*/
unsigned int alloc_normal, alloc_highmem;
static unsigned int alloc_normal, alloc_highmem;
/*
* Memory bitmap used for marking saveable pages (during hibernation) or
* hibernation image pages (during restore)
Expand Down

0 comments on commit bb47e96

Please sign in to comment.