Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Benjamin Herrenschmidt <benh@kernel.crashing.org>

+16
+2
arch/powerpc/include/asm/opal.h
··· 892 892 int depth, void *data); 893 893 894 894 extern int opal_notifier_register(struct notifier_block *nb); 895 + extern int opal_notifier_unregister(struct notifier_block *nb); 896 + 895 897 extern int opal_message_notifier_register(enum OpalMessageType msg_type, 896 898 struct notifier_block *nb); 897 899 extern void opal_notifier_enable(void);
+14
arch/powerpc/platforms/powernv/opal.c
··· 180 180 atomic_notifier_chain_register(&opal_notifier_head, nb); 181 181 return 0; 182 182 } 183 + EXPORT_SYMBOL_GPL(opal_notifier_register); 184 + 185 + int opal_notifier_unregister(struct notifier_block *nb) 186 + { 187 + if (!nb) { 188 + pr_warning("%s: Invalid argument (%p)\n", 189 + __func__, nb); 190 + return -EINVAL; 191 + } 192 + 193 + atomic_notifier_chain_unregister(&opal_notifier_head, nb); 194 + return 0; 195 + } 196 + EXPORT_SYMBOL_GPL(opal_notifier_unregister); 183 197 184 198 static void opal_do_notifier(uint64_t events) 185 199 {