From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751710AbcFYTYa (ORCPT ); Sat, 25 Jun 2016 15:24:30 -0400 Received: from 51.21-broadband.acttv.in ([106.51.21.48]:8076 "EHLO arvind-ThinkPad-Edge-E431" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751357AbcFYTY3 (ORCPT ); Sat, 25 Jun 2016 15:24:29 -0400 X-Greylist: delayed 87132 seconds by postgrey-1.27 at vger.kernel.org; Sat, 25 Jun 2016 15:24:28 EDT From: Arvind Yadav To: linux-kernel@vger.kernel.org Cc: linux-mips@linux-mips.org, Arvind Yadav Subject: [PATCH] cpu_pm :Dummy cpu_pm_register_notifier should return error code. Date: Sat, 25 Jun 2016 00:42:09 +0530 Message-Id: <1466795529-4797-1-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 #include +#include /* * 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