public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] soc: rockchip: power-domain: Handle errors from of_genpd_add_provider_onecell
@ 2016-09-15 10:43 Tomeu Vizoso
  2016-09-15 14:39 ` Heiko Stübner
  0 siblings, 1 reply; 4+ messages in thread
From: Tomeu Vizoso @ 2016-09-15 10:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Tomeu Vizoso, Caesar Wang, Heiko Stuebner, linux-arm-kernel,
	linux-rockchip

It was a bit surprising that the device was reported to have probed just
fine, but the provider hadn't been registered.

So handle any errors when registering the provider and fail the probe
accordingly.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: Caesar Wang <wxt@rock-chips.com>
---
 drivers/soc/rockchip/pm_domains.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c
index 7acd1517dd37..57e920128cb2 100644
--- a/drivers/soc/rockchip/pm_domains.c
+++ b/drivers/soc/rockchip/pm_domains.c
@@ -627,7 +627,11 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
 		goto err_out;
 	}
 
-	of_genpd_add_provider_onecell(np, &pmu->genpd_data);
+	error = of_genpd_add_provider_onecell(np, &pmu->genpd_data);
+	if (error) {
+		dev_err(dev, "failed to add provider: %d\n", error);
+		goto err_out;
+	}
 
 	return 0;
 
-- 
2.7.4

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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-15 10:43 [PATCH] soc: rockchip: power-domain: Handle errors from of_genpd_add_provider_onecell Tomeu Vizoso
2016-09-15 14:39 ` Heiko Stübner
2016-09-15 22:31   ` Heiko Stübner
2016-09-16  5:59     ` Tomeu Vizoso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox