All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PM / Domains: Allow holes in genpd_data.domains array
@ 2016-09-15 10:39 Tomeu Vizoso
  2016-09-15 11:03   ` Jon Hunter
  0 siblings, 1 reply; 9+ messages in thread
From: Tomeu Vizoso @ 2016-09-15 10:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Tomeu Vizoso, Jon Hunter, Heiko Stuebner, Rafael J. Wysocki,
	Kevin Hilman, Ulf Hansson, Len Brown, Pavel Machek,
	Greg Kroah-Hartman, linux-pm

In platforms such as Rockchip's, the array of domains isn't always
filled without holes, as which domains are present depend on the
particular SoC revision.

By allowing holes to be in the array, such SoCs can still use a single
set of constants to index the array of power domains.

Fixes: 0159ec670763 ("PM / Domains: Verify the PM domain is present when adding a provider")
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: Jon Hunter <jonathanh@nvidia.com>
Cc: Heiko Stuebner <heiko@sntech.de>
---
 drivers/base/power/domain.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index b0cf46dcae73..ce3f483ec67b 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1581,6 +1581,8 @@ int of_genpd_add_provider_onecell(struct device_node *np,
 	mutex_lock(&gpd_list_lock);
 
 	for (i = 0; i < data->num_domains; i++) {
+		if (!data->domains[i])
+			continue;
 		if (!pm_genpd_present(data->domains[i]))
 			goto error;
 
-- 
2.7.4

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

end of thread, other threads:[~2016-09-16 16:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-15 10:39 [PATCH] PM / Domains: Allow holes in genpd_data.domains array Tomeu Vizoso
2016-09-15 11:03 ` Jon Hunter
2016-09-15 11:03   ` Jon Hunter
2016-09-15 12:05   ` [PATCH v2] " Tomeu Vizoso
2016-09-15 13:20     ` Jon Hunter
2016-09-15 13:20       ` Jon Hunter
2016-09-15 14:16     ` Ulf Hansson
2016-09-15 22:00     ` Heiko Stübner
2016-09-16 16:13     ` Kevin Hilman

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.