From patchwork Wed Apr 27 03:22:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 66759 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1955507qge; Tue, 26 Apr 2016 20:23:06 -0700 (PDT) X-Received: by 10.66.119.177 with SMTP id kv17mr8651626pab.124.1461727386554; Tue, 26 Apr 2016 20:23:06 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n79si1445277pfi.149.2016.04.26.20.23.06; Tue, 26 Apr 2016 20:23:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752746AbcD0DXE (ORCPT + 29 others); Tue, 26 Apr 2016 23:23:04 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:35266 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752463AbcD0DW7 (ORCPT ); Tue, 26 Apr 2016 23:22:59 -0400 Received: by mail-pa0-f42.google.com with SMTP id iv1so14118649pac.2 for ; Tue, 26 Apr 2016 20:22:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=UAXZjLfuGjVOmnhGxV9v0byJ6KPuXssYAF+F+HODcds=; b=D0XAcczUrA8Na6F7DDgxEGvi/WVNYejs5+6zORYsj2KzXX0adFgo1pauF3Y8/qKp8K SuF6RooJIPcR8/iZyddqxm4RPsfCAc+dCVvoAdHVw7xp3GmUzqH5PwU7NhxyV2cTFI+C T4TFekOE/YfOe42ZDcnR8hINgQidZL+1xNhc8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=UAXZjLfuGjVOmnhGxV9v0byJ6KPuXssYAF+F+HODcds=; b=VXScAabjgwgjQ9hOo5r4IusTtOQD4HNDInmgDmN2nY3DGfWNmDHaa19Nmu2OAHUPP3 uHVRNsoMUqEb9LxTFFOb7vN9Yj3ZKJg6SCpvhmEWfWF6mAmC7Co0JpOTk3j6VXhMXeLA De2ttJado2A4z+eBXqJrijUMC/0Bo/zE6hyUZhwUV6FgLwqs9smYYtuqIyZM4TUBVAOo vrXaumVLtL1HrXp0G4j8AVdBp3OSCgjg+72umpAPH5koturg/hGoC5s0KcUmXlmTJxRM dRrMg8HS2+ECKnEtRoQfw+CxrKGxFdtCkFeG3bsSKGA9ndbBLtUkTvmISpXtupM66eCx C+YA== X-Gm-Message-State: AOPr4FUWQS+6ubUe4tWEhKDAIZltBqWumhRaQ20fm1RCW0vlmrKJJoa2JVTeqKnazOMJ39e3 X-Received: by 10.66.153.174 with SMTP id vh14mr8623629pab.131.1461727379042; Tue, 26 Apr 2016 20:22:59 -0700 (PDT) Received: from localhost ([122.167.143.140]) by smtp.gmail.com with ESMTPSA id i6sm1186303pfc.65.2016.04.26.20.22.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Apr 2016 20:22:58 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, arnd.bergmann@linaro.org, Viresh Kumar , linux-kernel@vger.kernel.org Subject: [PATCH V2 1/7] PM / OPP: -ENOSYS is applicable only to syscalls Date: Wed, 27 Apr 2016 08:52:21 +0530 Message-Id: X-Mailer: git-send-email 2.7.1.410.g6faf27b In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some of the routines have used -ENOSYS for the cases where the functionality isn't implemented in the kernel. But ENOSYS is supposed to be used only for syscalls. Replace that with -ENOTSUPP, which specifically means that the operation isn't supported. While at it, replace exiting -EINVAL errors for similar cases to -ENOTSUPP. Signed-off-by: Viresh Kumar --- include/linux/pm_opp.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) -- 2.7.1.410.g6faf27b diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 5b6ad31403a5..a2df8f6fcc25 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -110,25 +110,25 @@ static inline struct dev_pm_opp *dev_pm_opp_get_suspend_opp(struct device *dev) static inline struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev, unsigned long freq, bool available) { - return ERR_PTR(-EINVAL); + return ERR_PTR(-ENOTSUPP); } static inline struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev, unsigned long *freq) { - return ERR_PTR(-EINVAL); + return ERR_PTR(-ENOTSUPP); } static inline struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev, unsigned long *freq) { - return ERR_PTR(-EINVAL); + return ERR_PTR(-ENOTSUPP); } static inline int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt) { - return -EINVAL; + return -ENOTSUPP; } static inline void dev_pm_opp_remove(struct device *dev, unsigned long freq) @@ -148,40 +148,40 @@ static inline int dev_pm_opp_disable(struct device *dev, unsigned long freq) static inline struct srcu_notifier_head *dev_pm_opp_get_notifier( struct device *dev) { - return ERR_PTR(-EINVAL); + return ERR_PTR(-ENOTSUPP); } static inline int dev_pm_opp_set_supported_hw(struct device *dev, const u32 *versions, unsigned int count) { - return -EINVAL; + return -ENOTSUPP; } static inline void dev_pm_opp_put_supported_hw(struct device *dev) {} static inline int dev_pm_opp_set_prop_name(struct device *dev, const char *name) { - return -EINVAL; + return -ENOTSUPP; } static inline void dev_pm_opp_put_prop_name(struct device *dev) {} static inline int dev_pm_opp_set_regulator(struct device *dev, const char *name) { - return -EINVAL; + return -ENOTSUPP; } static inline void dev_pm_opp_put_regulator(struct device *dev) {} static inline int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq) { - return -EINVAL; + return -ENOTSUPP; } static inline int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask) { - return -ENOSYS; + return -ENOTSUPP; } #endif /* CONFIG_PM_OPP */ @@ -195,7 +195,7 @@ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask #else static inline int dev_pm_opp_of_add_table(struct device *dev) { - return -EINVAL; + return -ENOTSUPP; } static inline void dev_pm_opp_of_remove_table(struct device *dev) @@ -204,7 +204,7 @@ static inline void dev_pm_opp_of_remove_table(struct device *dev) static inline int dev_pm_opp_of_cpumask_add_table(cpumask_var_t cpumask) { - return -ENOSYS; + return -ENOTSUPP; } static inline void dev_pm_opp_of_cpumask_remove_table(cpumask_var_t cpumask) @@ -213,7 +213,7 @@ static inline void dev_pm_opp_of_cpumask_remove_table(cpumask_var_t cpumask) static inline int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask) { - return -ENOSYS; + return -ENOTSUPP; } #endif