[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171120174535.27000-2-mcgrof@kernel.org>
Date: Mon, 20 Nov 2017 09:45:31 -0800
From: "Luis R. Rodriguez" <mcgrof@...nel.org>
To: gregkh@...uxfoundation.org
Cc: keescook@...omium.org, mfuzzey@...keon.com,
zohar@...ux.vnet.ibm.com, dhowells@...hat.com,
pali.rohar@...il.com, tiwai@...e.de, arend.vanspriel@...adcom.com,
zajec5@...il.com, nbroeking@...com, markivx@...eaurora.org,
stephen.boyd@...aro.org, broonie@...nel.org,
dmitry.torokhov@...il.com, dwmw2@...radead.org,
torvalds@...ux-foundation.org, Abhay_Salunke@...l.com,
bjorn.andersson@...aro.org, jewalt@...innovations.com,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
"Luis R. Rodriguez" <mcgrof@...nel.org>
Subject: [PATCH 1/5] firmware: add helper to unregister pm ops
This will be used later to unfold on error on init.
Signed-off-by: Luis R. Rodriguez <mcgrof@...nel.org>
---
drivers/base/firmware_class.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 4b57cf5bc81d..149413a376cf 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -1767,11 +1767,20 @@ static int fw_suspend(void)
static struct syscore_ops fw_syscore_ops = {
.suspend = fw_suspend,
};
+
+static inline void unregister_fw_pm_ops(void)
+{
+ unregister_syscore_ops(&fw_syscore_ops);
+ unregister_pm_notifier(&fw_cache.pm_notify);
+}
#else
static int fw_cache_piggyback_on_request(const char *name)
{
return 0;
}
+static inline void unregister_fw_pm_ops(void)
+{
+}
#endif
static void __init fw_cache_init(void)
@@ -1823,10 +1832,7 @@ static int __init firmware_class_init(void)
static void __exit firmware_class_exit(void)
{
-#ifdef CONFIG_PM_SLEEP
- unregister_syscore_ops(&fw_syscore_ops);
- unregister_pm_notifier(&fw_cache.pm_notify);
-#endif
+ unregister_fw_pm_ops();
unregister_reboot_notifier(&fw_shutdown_nb);
#ifdef CONFIG_FW_LOADER_USER_HELPER
class_unregister(&firmware_class);
--
2.15.0
Powered by blists - more mailing lists