From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH 6/7] powerpc/powernv: Add opal_notifier_unregister() and export to modules
Date: Fri, 28 Mar 2014 13:36:31 +1100 [thread overview]
Message-ID: <1395974192-820-6-git-send-email-benh@kernel.crashing.org> (raw)
In-Reply-To: <1395974192-820-1-git-send-email-benh@kernel.crashing.org>
opal_notifier_register() is missing a pending "unregister" variant
and should be exposed to modules.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/include/asm/opal.h | 2 ++
arch/powerpc/platforms/powernv/opal.c | 14 ++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index ffafab0..1dd3f9b 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -891,6 +891,8 @@ extern int early_init_dt_scan_opal(unsigned long node, const char *uname,
int depth, void *data);
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,
struct notifier_block *nb);
extern void opal_notifier_enable(void);
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index e92f2f6..7835d5b 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -180,6 +180,20 @@ int opal_notifier_register(struct notifier_block *nb)
atomic_notifier_chain_register(&opal_notifier_head, nb);
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)
{
--
1.8.3.2
next prev parent reply other threads:[~2014-03-28 2:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-28 2:36 [PATCH 1/7] powerpc: Adjust CPU_FTR_SMT on all platforms Benjamin Herrenschmidt
2014-03-28 2:36 ` [PATCH 2/7] powerpc: Make boot_cpuid common between 32 and 64-bit Benjamin Herrenschmidt
2014-03-28 2:36 ` [PATCH 3/7] powerpc/prom: early_init_dt_scan_cpus() updates cpu features only once Benjamin Herrenschmidt
2014-03-28 2:36 ` [PATCH 4/7] powerpc/ppc64: Gracefully handle early interrupts Benjamin Herrenschmidt
2014-03-28 2:36 ` [PATCH 5/7] powerpc/ppc64: Do not turn AIL (reloc-on interrupts) too early Benjamin Herrenschmidt
2014-04-11 6:52 ` Michael Neuling
2014-03-28 2:36 ` Benjamin Herrenschmidt [this message]
2014-03-28 2:36 ` [PATCH 7/7] tty/hvc_opal: Kick the HVC thread on OPAL console events Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1395974192-820-6-git-send-email-benh@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).