All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] PM / Domains: Rename opp_node to np
@ 2018-06-14  5:23 Viresh Kumar
  2018-06-14  5:23 ` [PATCH 2/2] PM / Domains: Fix return value of of_genpd_opp_to_performance_state() Viresh Kumar
  2018-06-14  7:12 ` [PATCH 1/2] " Ulf Hansson
  0 siblings, 2 replies; 7+ messages in thread
From: Viresh Kumar @ 2018-06-14  5:23 UTC (permalink / raw)
  To: Rafael Wysocki, Kevin Hilman, Ulf Hansson, Len Brown, Pavel Machek
  Cc: Viresh Kumar, linux-pm, Vincent Guittot, Rajendra Nayak, linux-kernel

The DT node passed here isn't necessarily an OPP node, as this routine
can also be used for cases where the "required-opps" property is present
directly in the device's node. Rename it.

This also removes a stale comment.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/base/power/domain.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 4925af5c4cf0..c298de8a8308 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -2487,10 +2487,9 @@ EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states);
  * power domain corresponding to a DT node's "required-opps" property.
  *
  * @dev: Device for which the performance-state needs to be found.
- * @opp_node: DT node where the "required-opps" property is present. This can be
+ * @np: DT node where the "required-opps" property is present. This can be
  *	the device node itself (if it doesn't have an OPP table) or a node
  *	within the OPP table of a device (if device has an OPP table).
- * @state: Pointer to return performance state.
  *
  * Returns performance state corresponding to the "required-opps" property of
  * a DT node. This calls platform specific genpd->opp_to_performance_state()
@@ -2499,7 +2498,7 @@ EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states);
  * Returns performance state on success and 0 on failure.
  */
 unsigned int of_genpd_opp_to_performance_state(struct device *dev,
-					       struct device_node *opp_node)
+					       struct device_node *np)
 {
 	struct generic_pm_domain *genpd;
 	struct dev_pm_opp *opp;
@@ -2514,7 +2513,7 @@ unsigned int of_genpd_opp_to_performance_state(struct device *dev,
 
 	genpd_lock(genpd);
 
-	opp = of_dev_pm_opp_find_required_opp(&genpd->dev, opp_node);
+	opp = of_dev_pm_opp_find_required_opp(&genpd->dev, np);
 	if (IS_ERR(opp)) {
 		dev_err(dev, "Failed to find required OPP: %ld\n",
 			PTR_ERR(opp));
-- 
2.18.0.rc1.242.g61856ae69a2c


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] PM / Domains: Fix return value of of_genpd_opp_to_performance_state()
  2018-06-14  5:23 [PATCH 1/2] PM / Domains: Rename opp_node to np Viresh Kumar
@ 2018-06-14  5:23 ` Viresh Kumar
  2018-06-14  7:14   ` Ulf Hansson
  2018-06-20  6:15   ` [PATCH V2 2/2] PM / Domains: Rename opp_node to np Viresh Kumar
  2018-06-14  7:12 ` [PATCH 1/2] " Ulf Hansson
  1 sibling, 2 replies; 7+ messages in thread
From: Viresh Kumar @ 2018-06-14  5:23 UTC (permalink / raw)
  To: Rafael Wysocki, Kevin Hilman, Ulf Hansson
  Cc: Viresh Kumar, linux-pm, Vincent Guittot, Rajendra Nayak, linux-kernel

of_genpd_opp_to_performance_state() should return 0 for errors, but the
dummy routine isn't doing that. Fix it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 include/linux/pm_domain.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 9206a4fef9ac..139f79c8477a 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -276,7 +276,7 @@ static inline unsigned int
 of_genpd_opp_to_performance_state(struct device *dev,
 				  struct device_node *opp_node)
 {
-	return -ENODEV;
+	return 0;
 }
 
 static inline int genpd_dev_pm_attach(struct device *dev)
-- 
2.18.0.rc1.242.g61856ae69a2c


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] PM / Domains: Rename opp_node to np
  2018-06-14  5:23 [PATCH 1/2] PM / Domains: Rename opp_node to np Viresh Kumar
  2018-06-14  5:23 ` [PATCH 2/2] PM / Domains: Fix return value of of_genpd_opp_to_performance_state() Viresh Kumar
@ 2018-06-14  7:12 ` Ulf Hansson
  1 sibling, 0 replies; 7+ messages in thread
From: Ulf Hansson @ 2018-06-14  7:12 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Rafael Wysocki, Kevin Hilman, Len Brown, Pavel Machek, Linux PM,
	Vincent Guittot, Rajendra Nayak, Linux Kernel Mailing List

On 14 June 2018 at 07:23, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> The DT node passed here isn't necessarily an OPP node, as this routine
> can also be used for cases where the "required-opps" property is present
> directly in the device's node. Rename it.
>
> This also removes a stale comment.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  drivers/base/power/domain.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 4925af5c4cf0..c298de8a8308 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -2487,10 +2487,9 @@ EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states);
>   * power domain corresponding to a DT node's "required-opps" property.
>   *
>   * @dev: Device for which the performance-state needs to be found.
> - * @opp_node: DT node where the "required-opps" property is present. This can be
> + * @np: DT node where the "required-opps" property is present. This can be
>   *     the device node itself (if it doesn't have an OPP table) or a node
>   *     within the OPP table of a device (if device has an OPP table).
> - * @state: Pointer to return performance state.
>   *
>   * Returns performance state corresponding to the "required-opps" property of
>   * a DT node. This calls platform specific genpd->opp_to_performance_state()
> @@ -2499,7 +2498,7 @@ EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states);
>   * Returns performance state on success and 0 on failure.
>   */
>  unsigned int of_genpd_opp_to_performance_state(struct device *dev,
> -                                              struct device_node *opp_node)
> +                                              struct device_node *np)
>  {
>         struct generic_pm_domain *genpd;
>         struct dev_pm_opp *opp;
> @@ -2514,7 +2513,7 @@ unsigned int of_genpd_opp_to_performance_state(struct device *dev,
>
>         genpd_lock(genpd);
>
> -       opp = of_dev_pm_opp_find_required_opp(&genpd->dev, opp_node);
> +       opp = of_dev_pm_opp_find_required_opp(&genpd->dev, np);
>         if (IS_ERR(opp)) {
>                 dev_err(dev, "Failed to find required OPP: %ld\n",
>                         PTR_ERR(opp));
> --
> 2.18.0.rc1.242.g61856ae69a2c
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] PM / Domains: Fix return value of of_genpd_opp_to_performance_state()
  2018-06-14  5:23 ` [PATCH 2/2] PM / Domains: Fix return value of of_genpd_opp_to_performance_state() Viresh Kumar
@ 2018-06-14  7:14   ` Ulf Hansson
  2018-06-20  6:15   ` [PATCH V2 2/2] PM / Domains: Rename opp_node to np Viresh Kumar
  1 sibling, 0 replies; 7+ messages in thread
From: Ulf Hansson @ 2018-06-14  7:14 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Rafael Wysocki, Kevin Hilman, Linux PM, Vincent Guittot,
	Rajendra Nayak, Linux Kernel Mailing List

On 14 June 2018 at 07:23, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> of_genpd_opp_to_performance_state() should return 0 for errors, but the
> dummy routine isn't doing that. Fix it.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  include/linux/pm_domain.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
> index 9206a4fef9ac..139f79c8477a 100644
> --- a/include/linux/pm_domain.h
> +++ b/include/linux/pm_domain.h
> @@ -276,7 +276,7 @@ static inline unsigned int
>  of_genpd_opp_to_performance_state(struct device *dev,
>                                   struct device_node *opp_node)
>  {
> -       return -ENODEV;
> +       return 0;
>  }
>
>  static inline int genpd_dev_pm_attach(struct device *dev)
> --
> 2.18.0.rc1.242.g61856ae69a2c
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH V2 2/2] PM / Domains: Rename opp_node to np
  2018-06-14  5:23 ` [PATCH 2/2] PM / Domains: Fix return value of of_genpd_opp_to_performance_state() Viresh Kumar
  2018-06-14  7:14   ` Ulf Hansson
@ 2018-06-20  6:15   ` Viresh Kumar
  2018-06-20  6:19     ` Viresh Kumar
  1 sibling, 1 reply; 7+ messages in thread
From: Viresh Kumar @ 2018-06-20  6:15 UTC (permalink / raw)
  To: Rafael Wysocki, Kevin Hilman, Ulf Hansson, Pavel Machek, Len Brown
  Cc: Viresh Kumar, linux-pm, Vincent Guittot, Rajendra Nayak, linux-kernel

The DT node passed here isn't necessarily an OPP node, as this routine
can also be used for cases where the "required-opps" property is present
directly in the device's node. Rename it.

This also removes a stale comment.

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
V2:
- Updated variable name in header file as well.
- Because it was a very small change, I added Ulf's Ack as well.

 drivers/base/power/domain.c | 7 +++----
 include/linux/pm_domain.h   | 4 ++--
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 4925af5c4cf0..c298de8a8308 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -2487,10 +2487,9 @@ EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states);
  * power domain corresponding to a DT node's "required-opps" property.
  *
  * @dev: Device for which the performance-state needs to be found.
- * @opp_node: DT node where the "required-opps" property is present. This can be
+ * @np: DT node where the "required-opps" property is present. This can be
  *	the device node itself (if it doesn't have an OPP table) or a node
  *	within the OPP table of a device (if device has an OPP table).
- * @state: Pointer to return performance state.
  *
  * Returns performance state corresponding to the "required-opps" property of
  * a DT node. This calls platform specific genpd->opp_to_performance_state()
@@ -2499,7 +2498,7 @@ EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states);
  * Returns performance state on success and 0 on failure.
  */
 unsigned int of_genpd_opp_to_performance_state(struct device *dev,
-					       struct device_node *opp_node)
+					       struct device_node *np)
 {
 	struct generic_pm_domain *genpd;
 	struct dev_pm_opp *opp;
@@ -2514,7 +2513,7 @@ unsigned int of_genpd_opp_to_performance_state(struct device *dev,
 
 	genpd_lock(genpd);
 
-	opp = of_dev_pm_opp_find_required_opp(&genpd->dev, opp_node);
+	opp = of_dev_pm_opp_find_required_opp(&genpd->dev, np);
 	if (IS_ERR(opp)) {
 		dev_err(dev, "Failed to find required OPP: %ld\n",
 			PTR_ERR(opp));
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 9206a4fef9ac..e1d18ce3a310 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -234,7 +234,7 @@ struct generic_pm_domain *of_genpd_remove_last(struct device_node *np);
 int of_genpd_parse_idle_states(struct device_node *dn,
 			       struct genpd_power_state **states, int *n);
 unsigned int of_genpd_opp_to_performance_state(struct device *dev,
-				struct device_node *opp_node);
+				struct device_node *np);
 
 int genpd_dev_pm_attach(struct device *dev);
 struct device *genpd_dev_pm_attach_by_id(struct device *dev,
@@ -274,7 +274,7 @@ static inline int of_genpd_parse_idle_states(struct device_node *dn,
 
 static inline unsigned int
 of_genpd_opp_to_performance_state(struct device *dev,
-				  struct device_node *opp_node)
+				  struct device_node *np)
 {
 	return -ENODEV;
 }
-- 
2.18.0.rc1.242.g61856ae69a2c


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH V2 2/2] PM / Domains: Rename opp_node to np
  2018-06-20  6:15   ` [PATCH V2 2/2] PM / Domains: Rename opp_node to np Viresh Kumar
@ 2018-06-20  6:19     ` Viresh Kumar
  2018-06-29  8:53       ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Viresh Kumar @ 2018-06-20  6:19 UTC (permalink / raw)
  To: Rafael Wysocki, Kevin Hilman, Ulf Hansson, Pavel Machek, Len Brown
  Cc: linux-pm, Vincent Guittot, Rajendra Nayak, linux-kernel

On 20-06-18, 11:45, Viresh Kumar wrote:

The subject should be "[PATCH V2 1/2] ***" instead.

-- 
viresh

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V2 2/2] PM / Domains: Rename opp_node to np
  2018-06-20  6:19     ` Viresh Kumar
@ 2018-06-29  8:53       ` Rafael J. Wysocki
  0 siblings, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2018-06-29  8:53 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Kevin Hilman, Ulf Hansson, Pavel Machek, Len Brown, linux-pm,
	Vincent Guittot, Rajendra Nayak, linux-kernel

On Wednesday, June 20, 2018 8:19:28 AM CEST Viresh Kumar wrote:
> On 20-06-18, 11:45, Viresh Kumar wrote:
> 
> The subject should be "[PATCH V2 1/2] ***" instead.
> 
> 

Applied along with the [1/2], thanks!



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-06-29  8:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-14  5:23 [PATCH 1/2] PM / Domains: Rename opp_node to np Viresh Kumar
2018-06-14  5:23 ` [PATCH 2/2] PM / Domains: Fix return value of of_genpd_opp_to_performance_state() Viresh Kumar
2018-06-14  7:14   ` Ulf Hansson
2018-06-20  6:15   ` [PATCH V2 2/2] PM / Domains: Rename opp_node to np Viresh Kumar
2018-06-20  6:19     ` Viresh Kumar
2018-06-29  8:53       ` Rafael J. Wysocki
2018-06-14  7:12 ` [PATCH 1/2] " Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.