[v4,2/3] interconnect: Relax requirement in of_icc_get_from_provider()
diff mbox series

Message ID 20200116144202.12116-3-a.swigon@samsung.com
State Not Applicable
Headers show
Series
  • [v4,1/3] interconnect: Export of_icc_get_from_provider()
Related show

Commit Message

Artur Świgoń Jan. 16, 2020, 2:42 p.m. UTC
This patch relaxes the condition in of_icc_get_from_provider() so that
it is no longer required to set '#interconnect-cells' to <1> in the DT,
and therefore it is not required to supply dummy node IDs in the
'interconnects' property when node IDs are dynamically generated rather
than hardcoded (statically allocated).

In case of the devfreq driver for exynos-bus, node IDs are dynamically
allocated and '#interconnect-cells' is always zero.

Signed-off-by: Artur Świgoń <a.swigon@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/interconnect/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Chanwoo Choi Jan. 17, 2020, 5:24 a.m. UTC | #1
Hi,

On 1/16/20 11:42 PM, Artur Świgoń wrote:
> This patch relaxes the condition in of_icc_get_from_provider() so that
> it is no longer required to set '#interconnect-cells' to <1> in the DT,
> and therefore it is not required to supply dummy node IDs in the
> 'interconnects' property when node IDs are dynamically generated rather
> than hardcoded (statically allocated).
> 
> In case of the devfreq driver for exynos-bus, node IDs are dynamically
> allocated and '#interconnect-cells' is always zero.
> 
> Signed-off-by: Artur Świgoń <a.swigon@samsung.com>
> Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  drivers/interconnect/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
> index 0be1764d3528..5ea270af5ff4 100644
> --- a/drivers/interconnect/core.c
> +++ b/drivers/interconnect/core.c
> @@ -335,7 +335,7 @@ struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec)
>  	struct icc_node *node = ERR_PTR(-EPROBE_DEFER);
>  	struct icc_provider *provider;
>  
> -	if (!spec || spec->args_count != 1)
> +	if (!spec)
>  		return ERR_PTR(-EINVAL);
>  
>  	mutex_lock(&icc_lock);
> 

Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>

Patch
diff mbox series

diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
index 0be1764d3528..5ea270af5ff4 100644
--- a/drivers/interconnect/core.c
+++ b/drivers/interconnect/core.c
@@ -335,7 +335,7 @@  struct icc_node *of_icc_get_from_provider(struct of_phandle_args *spec)
 	struct icc_node *node = ERR_PTR(-EPROBE_DEFER);
 	struct icc_provider *provider;
 
-	if (!spec || spec->args_count != 1)
+	if (!spec)
 		return ERR_PTR(-EINVAL);
 
 	mutex_lock(&icc_lock);