diff mbox

[V4,1/8] opp: of_init_opp_table(): return -ENOSYS when feature isn't implemented

Message ID 231be85cd01bcdc00a0a7936cd9ba57ccba52749.1401191054.git.viresh.kumar@linaro.org
State New
Headers show

Commit Message

Viresh Kumar May 27, 2014, 11:50 a.m. UTC
When none of CONFIG_PM_OPP or CONFIG_OF is enabled we use the dummy
implementation of of_init_opp_table() routine, which returns -EINVAL currently.
-EINVAL can confuse the callers a bit as it can have other meanings for the
actual implementation of this routine.

It is more appropriate to return -ENOSYS instead to avoid confusion at caller.

Suggested-and-reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 include/linux/pm_opp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nishanth Menon May 29, 2014, 10:19 p.m. UTC | #1
minor (Rafael usually fixes it up, but still):
$subject: PM / OPP:

On 05/27/2014 06:50 AM, Viresh Kumar wrote:
> When none of CONFIG_PM_OPP or CONFIG_OF is enabled we use the dummy
> implementation of of_init_opp_table() routine, which returns -EINVAL currently.
> -EINVAL can confuse the callers a bit as it can have other meanings for the
> actual implementation of this routine.
> 
> It is more appropriate to return -ENOSYS instead to avoid confusion at caller.
> 
> Suggested-and-reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

otherwise,

Acked-by: Nishanth Menon <nm@ti.com>

> ---
>  include/linux/pm_opp.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h
> index 0330217..6668150 100644
> --- a/include/linux/pm_opp.h
> +++ b/include/linux/pm_opp.h
> @@ -112,7 +112,7 @@ int of_init_opp_table(struct device *dev);
>  #else
>  static inline int of_init_opp_table(struct device *dev)
>  {
> -	return -EINVAL;
> +	return -ENOSYS;
>  }
>  #endif
>  
>
diff mbox

Patch

diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h
index 0330217..6668150 100644
--- a/include/linux/pm_opp.h
+++ b/include/linux/pm_opp.h
@@ -112,7 +112,7 @@  int of_init_opp_table(struct device *dev);
 #else
 static inline int of_init_opp_table(struct device *dev)
 {
-	return -EINVAL;
+	return -ENOSYS;
 }
 #endif