From: Georgi Djakov Subject: Re: [PATCH v4 27/37] interconnect: Relax requirement in of_icc_get_from_provider() Date: Wed, 1 Jul 2020 20:10:09 +0300 Message-ID: <3b410ea3-26d3-6f7a-213c-40dbabbde8d1@linaro.org> References: <20200609131404.17523-1-digetx@gmail.com> <20200609131404.17523-28-digetx@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20200609131404.17523-28-digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Content-Language: en-US Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Dmitry Osipenko Cc: Thierry Reding , Jonathan Hunter , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen , =?UTF-8?B?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-tegra@vger.kernel.org Hi Dmitry, On 6/9/20 16:13, Dmitry Osipenko wrote: > From: Artur Świgoń > > This patch relaxes the condition in of_icc_get_from_provider() so that it > is no longer required to set #interconnect-cells = <1> in the DT. In case > of the devfreq driver for exynos-bus, #interconnect-cells is always zero. > > Signed-off-by: Artur Świgoń > [digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org: added cells_num checking for of_icc_xlate_onecell()] > Signed-off-by: Dmitry Osipenko I have already applied the original patch by Artur, so please make the cells_num check a separate patch. Thanks, Georgi > --- > drivers/interconnect/core.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c > index e5f998744501..cb143421ca67 100644 > --- a/drivers/interconnect/core.c > +++ b/drivers/interconnect/core.c > @@ -339,7 +339,7 @@ static 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); > @@ -967,6 +967,15 @@ EXPORT_SYMBOL_GPL(icc_nodes_remove); > */ > int icc_provider_add(struct icc_provider *provider) > { > + struct device_node *np = provider->dev->of_node; > + u32 cells_num; > + int err; > + > + err = of_property_read_u32(np, "#interconnect-cells", &cells_num); > + if (WARN_ON(err)) > + return err; > + if (WARN_ON(provider->xlate == of_icc_xlate_onecell && cells_num != 1)) > + return -EINVAL; > if (WARN_ON(!provider->set)) > return -EINVAL; > if (WARN_ON(!provider->xlate)) >