From: "Luis R. Rodriguez" <mcgrof@kernel.org>
To: gregkh@linuxfoundation.org
Cc: keescook@chromium.org, mfuzzey@parkeon.com,
zohar@linux.vnet.ibm.com, dhowells@redhat.com,
pali.rohar@gmail.com, tiwai@suse.de,
arend.vanspriel@broadcom.com, zajec5@gmail.com, nbroeking@me.com,
markivx@codeaurora.org, stephen.boyd@linaro.org,
broonie@kernel.org, dmitry.torokhov@gmail.com,
dwmw2@infradead.org, torvalds@linux-foundation.org,
Abhay_Salunke@dell.com, bjorn.andersson@linaro.org,
jewalt@lgsinnovations.com, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org,
"Luis R. Rodriguez" <mcgrof@kernel.org>
Subject: [PATCH 1/5] firmware: add helper to unregister pm ops
Date: Mon, 20 Nov 2017 09:45:31 -0800 [thread overview]
Message-ID: <20171120174535.27000-2-mcgrof@kernel.org> (raw)
In-Reply-To: <20171120174535.27000-1-mcgrof@kernel.org>
This will be used later to unfold on error on init.
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.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
next prev parent reply other threads:[~2017-11-20 17:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-20 17:45 [PATCH 0/5] firmware: few fixes for v4.15 Luis R. Rodriguez
2017-11-20 17:45 ` Luis R. Rodriguez [this message]
2017-11-20 17:45 ` [PATCH 2/5] firmware: fix capturing errors on fw_cache_init() on early init Luis R. Rodriguez
2017-11-20 17:45 ` [PATCH 3/5] firmware: provide helpers for registering the syfs loader Luis R. Rodriguez
2017-11-20 17:45 ` [PATCH 4/5] firmware: fix detecting error on register_reboot_notifier() Luis R. Rodriguez
2017-11-20 17:45 ` [PATCH 5/5] test_firmware: fix setting old custom fw path back on exit Luis R. Rodriguez
2017-11-29 10:07 ` [PATCH 0/5] firmware: few fixes for v4.15 Greg KH
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=20171120174535.27000-2-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=Abhay_Salunke@dell.com \
--cc=arend.vanspriel@broadcom.com \
--cc=bjorn.andersson@linaro.org \
--cc=broonie@kernel.org \
--cc=dhowells@redhat.com \
--cc=dmitry.torokhov@gmail.com \
--cc=dwmw2@infradead.org \
--cc=gregkh@linuxfoundation.org \
--cc=jewalt@lgsinnovations.com \
--cc=keescook@chromium.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=markivx@codeaurora.org \
--cc=mfuzzey@parkeon.com \
--cc=nbroeking@me.com \
--cc=pali.rohar@gmail.com \
--cc=stephen.boyd@linaro.org \
--cc=tiwai@suse.de \
--cc=torvalds@linux-foundation.org \
--cc=zajec5@gmail.com \
--cc=zohar@linux.vnet.ibm.com \
/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).