ARM: bL_switcher: Allow detachment of outstanding switch requests

In rare situations, it may be neecssary to prevent a completer
registered using bL_switch_request_cb() from being called.

For example, a cpufreq driver module needs to ensure that its
completer won't get called if the module is about to be unloaded
from the kernel.

This patch provides a bL_switch_request_detach() function which
detaches the completer from an outstanding request.  The request
continues in the background, as if it had been started using
bL_switch_request().

If somebody else's completer is registered instead then the caller
shouldn't care about it, so nothing is done in this case.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
diff --git a/arch/arm/include/asm/bL_switcher.h b/arch/arm/include/asm/bL_switcher.h
index 9842759..71d1b6a 100644
--- a/arch/arm/include/asm/bL_switcher.h
+++ b/arch/arm/include/asm/bL_switcher.h
@@ -40,6 +40,9 @@
 
 #ifdef CONFIG_BL_SWITCHER
 
+void bL_switch_request_detach(unsigned int cpu,
+			      bL_switch_completion_handler completer);
+
 int bL_switcher_register_notifier(struct notifier_block *nb);
 int bL_switcher_unregister_notifier(struct notifier_block *nb);
 
@@ -55,6 +58,9 @@
 void bL_switcher_put_enabled(void);
 
 #else
+static void bL_switch_request_detach(unsigned int cpu,
+				     bL_switch_completion_handler completer) { }
+
 static inline int bL_switcher_register_notifier(struct notifier_block *nb)
 {
 	return 0;