Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82376
b: refs/heads/master
c: 8252575
h: refs/heads/master
v: v3
  • Loading branch information
Alan Stern authored and Len Brown committed Feb 1, 2008
1 parent 79ce713 commit b98af34
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 90dda1cb6ace6abd777f84bf051c4f86fa58986a
refs/heads/master: 825257569350e913bee3bc918508c0aa6e3398cd
13 changes: 2 additions & 11 deletions trunk/include/linux/suspend.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,8 @@ void save_processor_state(void);
void restore_processor_state(void);

/* kernel/power/main.c */
extern struct blocking_notifier_head pm_chain_head;

static inline int register_pm_notifier(struct notifier_block *nb)
{
return blocking_notifier_chain_register(&pm_chain_head, nb);
}

static inline int unregister_pm_notifier(struct notifier_block *nb)
{
return blocking_notifier_chain_unregister(&pm_chain_head, nb);
}
extern int register_pm_notifier(struct notifier_block *nb);
extern int unregister_pm_notifier(struct notifier_block *nb);

#define pm_notifier(fn, pri) { \
static struct notifier_block fn##_nb = \
Expand Down
28 changes: 26 additions & 2 deletions trunk/kernel/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,37 @@

#include "power.h"

BLOCKING_NOTIFIER_HEAD(pm_chain_head);

DEFINE_MUTEX(pm_mutex);

unsigned int pm_flags;
EXPORT_SYMBOL(pm_flags);

#ifdef CONFIG_PM_SLEEP

/* Routines for PM-transition notifications */

static BLOCKING_NOTIFIER_HEAD(pm_chain_head);

int register_pm_notifier(struct notifier_block *nb)
{
return blocking_notifier_chain_register(&pm_chain_head, nb);
}
EXPORT_SYMBOL_GPL(register_pm_notifier);

int unregister_pm_notifier(struct notifier_block *nb)
{
return blocking_notifier_chain_unregister(&pm_chain_head, nb);
}
EXPORT_SYMBOL_GPL(unregister_pm_notifier);

int pm_notifier_call_chain(unsigned long val)
{
return (blocking_notifier_call_chain(&pm_chain_head, val, NULL)
== NOTIFY_BAD) ? -EINVAL : 0;
}

#endif /* CONFIG_PM_SLEEP */

#ifdef CONFIG_PM_DEBUG
int pm_test_level = TEST_NONE;

Expand Down
12 changes: 4 additions & 8 deletions trunk/kernel/power/power.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,10 @@ static inline int suspend_devices_and_enter(suspend_state_t state)
}
#endif /* !CONFIG_SUSPEND */

/* kernel/power/common.c */
extern struct blocking_notifier_head pm_chain_head;

static inline int pm_notifier_call_chain(unsigned long val)
{
return (blocking_notifier_call_chain(&pm_chain_head, val, NULL)
== NOTIFY_BAD) ? -EINVAL : 0;
}
#ifdef CONFIG_PM_SLEEP
/* kernel/power/main.c */
extern int pm_notifier_call_chain(unsigned long val);
#endif

#ifdef CONFIG_HIGHMEM
unsigned int count_highmem_pages(void);
Expand Down

0 comments on commit b98af34

Please sign in to comment.