powerpc/powernv: Add opal_notifier_unregister() and export to modules

opal_notifier_register() is missing a pending "unregister" variant
and should be exposed to modules.
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 8f619b54
...@@ -892,6 +892,8 @@ extern int early_init_dt_scan_opal(unsigned long node, const char *uname, ...@@ -892,6 +892,8 @@ extern int early_init_dt_scan_opal(unsigned long node, const char *uname,
int depth, void *data); int depth, void *data);
extern int opal_notifier_register(struct notifier_block *nb); extern int opal_notifier_register(struct notifier_block *nb);
extern int opal_notifier_unregister(struct notifier_block *nb);
extern int opal_message_notifier_register(enum OpalMessageType msg_type, extern int opal_message_notifier_register(enum OpalMessageType msg_type,
struct notifier_block *nb); struct notifier_block *nb);
extern void opal_notifier_enable(void); extern void opal_notifier_enable(void);
......
...@@ -180,6 +180,20 @@ int opal_notifier_register(struct notifier_block *nb) ...@@ -180,6 +180,20 @@ int opal_notifier_register(struct notifier_block *nb)
atomic_notifier_chain_register(&opal_notifier_head, nb); atomic_notifier_chain_register(&opal_notifier_head, nb);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(opal_notifier_register);
int opal_notifier_unregister(struct notifier_block *nb)
{
if (!nb) {
pr_warning("%s: Invalid argument (%p)\n",
__func__, nb);
return -EINVAL;
}
atomic_notifier_chain_unregister(&opal_notifier_head, nb);
return 0;
}
EXPORT_SYMBOL_GPL(opal_notifier_unregister);
static void opal_do_notifier(uint64_t events) static void opal_do_notifier(uint64_t events)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment