]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
firmware: qcom: scm: Return PTR_ERR when devm_clk_get fails
authorspjoshi@codeaurora.org <spjoshi@codeaurora.org>
Wed, 16 Nov 2016 01:19:25 +0000 (17:19 -0800)
committerAndy Gross <andy.gross@linaro.org>
Wed, 23 Nov 2016 17:03:00 +0000 (11:03 -0600)
When devm_clk_get fails for core clock, the failure was ignored
and the core_clk was explicitly set to NULL so that other
remaining clocks can be queried. However, now that we have a
cleaner way of expressing the clock dependency, return failure
when devm_clk_get fails for core clock.

Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
drivers/firmware/qcom_scm.c

index 7a104d31ef0f682319175cb047b4f1eaf3d5cc44..893f953eaccfdadbe98c4234e0e20043d5750432 100644 (file)
@@ -338,10 +338,10 @@ static int qcom_scm_probe(struct platform_device *pdev)
        if (clks & SCM_HAS_CORE_CLK) {
                scm->core_clk = devm_clk_get(&pdev->dev, "core");
                if (IS_ERR(scm->core_clk)) {
-                       if (PTR_ERR(scm->core_clk) == -EPROBE_DEFER)
-                               return PTR_ERR(scm->core_clk);
-
-                       scm->core_clk = NULL;
+                       if (PTR_ERR(scm->core_clk) != -EPROBE_DEFER)
+                               dev_err(&pdev->dev,
+                                       "failed to acquire core clk\n");
+                       return PTR_ERR(scm->core_clk);
                }
        }