soc: rockchip: power-domain: Handle errors from of_genpd_add_provider_onecell
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Thu, 15 Sep 2016 22:14:39 +0000 (00:14 +0200)
committerHeiko Stuebner <heiko@sntech.de>
Fri, 11 Nov 2016 01:14:59 +0000 (02:14 +0100)
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>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
drivers/soc/rockchip/pm_domains.c

index d36a735..1c78c42 100644 (file)
@@ -672,7 +672,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;