LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] of: Don't create platform device for OPP tables
@ 2018-04-10 9:05 Viresh Kumar
2018-04-10 18:20 ` Stephen Boyd
2018-04-13 13:07 ` Rob Herring
0 siblings, 2 replies; 3+ messages in thread
From: Viresh Kumar @ 2018-04-10 9:05 UTC (permalink / raw)
To: Rob Herring, Frank Rowand
Cc: Viresh Kumar, Vincent Guittot, linux-kernel, Stephen Boyd, devicetree
The OPP tables are present as separate nodes, whose phandle is used in
the "operating-points-v2" property of devices. Currently the OF core
creates a platform device for the OPP table unconditionally, which is
not used by any kernel code.
Skip creating OPP table platform devices.
Reported-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/of/platform.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index c00d81dfac0b..aaae5d90433d 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -356,6 +356,12 @@ static int of_platform_bus_create(struct device_node *bus,
return 0;
}
+ /* OPP tables have separate nodes, but we don't want devices for them */
+ if (unlikely(of_device_is_compatible(bus, "operating-points-v2"))) {
+ pr_debug("%s() - skipping OPP node %pOF\n", __func__, bus);
+ return 0;
+ }
+
if (of_node_check_flag(bus, OF_POPULATED_BUS)) {
pr_debug("%s() - skipping %pOF, already populated\n",
__func__, bus);
--
2.15.0.194.g9af6a3dea062
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] of: Don't create platform device for OPP tables
2018-04-10 9:05 [PATCH] of: Don't create platform device for OPP tables Viresh Kumar
@ 2018-04-10 18:20 ` Stephen Boyd
2018-04-13 13:07 ` Rob Herring
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2018-04-10 18:20 UTC (permalink / raw)
To: Frank Rowand, Rob Herring, Viresh Kumar
Cc: Viresh Kumar, Vincent Guittot, linux-kernel, devicetree
Quoting Viresh Kumar (2018-04-10 02:05:22)
> The OPP tables are present as separate nodes, whose phandle is used in
> the "operating-points-v2" property of devices. Currently the OF core
> creates a platform device for the OPP table unconditionally, which is
> not used by any kernel code.
>
> Skip creating OPP table platform devices.
>
> Reported-by: Stephen Boyd <sboyd@kernel.org>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] of: Don't create platform device for OPP tables
2018-04-10 9:05 [PATCH] of: Don't create platform device for OPP tables Viresh Kumar
2018-04-10 18:20 ` Stephen Boyd
@ 2018-04-13 13:07 ` Rob Herring
1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2018-04-13 13:07 UTC (permalink / raw)
To: Viresh Kumar
Cc: Frank Rowand, Vincent Guittot, linux-kernel, Stephen Boyd, devicetree
On Tue, Apr 10, 2018 at 4:05 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> The OPP tables are present as separate nodes, whose phandle is used in
> the "operating-points-v2" property of devices. Currently the OF core
> creates a platform device for the OPP table unconditionally, which is
> not used by any kernel code.
>
> Skip creating OPP table platform devices.
>
> Reported-by: Stephen Boyd <sboyd@kernel.org>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> drivers/of/platform.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> index c00d81dfac0b..aaae5d90433d 100644
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -356,6 +356,12 @@ static int of_platform_bus_create(struct device_node *bus,
> return 0;
> }
>
> + /* OPP tables have separate nodes, but we don't want devices for them */
> + if (unlikely(of_device_is_compatible(bus, "operating-points-v2"))) {
Can you make this a match table instead. I could imagine we may have
some other cases to add.
> + pr_debug("%s() - skipping OPP node %pOF\n", __func__, bus);
> + return 0;
> + }
> +
> if (of_node_check_flag(bus, OF_POPULATED_BUS)) {
> pr_debug("%s() - skipping %pOF, already populated\n",
> __func__, bus);
> --
> 2.15.0.194.g9af6a3dea062
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-04-13 13:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-10 9:05 [PATCH] of: Don't create platform device for OPP tables Viresh Kumar
2018-04-10 18:20 ` Stephen Boyd
2018-04-13 13:07 ` Rob Herring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).