From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Subject: [PATCH] cpu_pm :Dummy cpu_pm_register_notifier should return error code.
Date: Sat, 25 Jun 2016 00:41:37 +0530 [thread overview]
Message-ID: <1466795497-4744-1-git-send-email-arvind.yadav.cs@gmail.com> (raw)
The inline cpu_pm_register_notifier stub simply allows compilation
on systems with CONFIG_CPU_PM disabled. The dummy
cpu_pm_register_notifier does not register an trap_pm_init,
r4k_tlb_init_pm and r4k_cache_init_pm at all.The inline
cpu_pm_register_notifier should return to indicate lack of support
when attempting to register an cpu_pm_register_notifier on such a
system with CONFIG_CPU_PM disabled.
The return value of cpu_pm_register_notifier is in trap_pm_init,
r4k_tlb_init_pm and r4k_cache_init_pm where CONFIG_CPU_PM is disable,
all other places do not care about the return value.
So cpu_pm_register_notifier must returning -ENODEV.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
include/linux/cpu_pm.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/linux/cpu_pm.h b/include/linux/cpu_pm.h
index 455b233..206c264 100644
--- a/include/linux/cpu_pm.h
+++ b/include/linux/cpu_pm.h
@@ -20,6 +20,7 @@
#include <linux/kernel.h>
#include <linux/notifier.h>
+#include <linux/errno.h>
/*
* When a CPU goes to a low power state that turns off power to the CPU's
@@ -78,7 +79,7 @@ int cpu_cluster_pm_exit(void);
static inline int cpu_pm_register_notifier(struct notifier_block *nb)
{
- return 0;
+ return -ENODEV;
}
static inline int cpu_pm_unregister_notifier(struct notifier_block *nb)
--
1.9.1
next reply other threads:[~2016-06-24 19:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-24 19:11 Arvind Yadav [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-06-24 19:12 [PATCH] cpu_pm :Dummy cpu_pm_register_notifier should return error code Arvind Yadav
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=1466795497-4744-1-git-send-email-arvind.yadav.cs@gmail.com \
--to=arvind.yadav.cs@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.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).