From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lina Iyer Subject: Re: [PATCH] drivers: qcom: rpmh-rsc: Check cmd_db_ready() to help children Date: Mon, 18 Jun 2018 11:42:07 -0600 Message-ID: <20180618174207.GF21724@codeaurora.org> References: <20180618172230.241960-1-dianders@chromium.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Return-path: Content-Disposition: inline In-Reply-To: <20180618172230.241960-1-dianders@chromium.org> Sender: linux-kernel-owner@vger.kernel.org To: Douglas Anderson Cc: andy.gross@linaro.org, tdas@codeaurora.org, collinsd@codeaurora.org, sboyd@kernel.org, broonie@kernel.org, rplsssn@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, David Brown , linux-kernel@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org On Mon, Jun 18 2018 at 11:23 -0600, Douglas Anderson wrote: >Children of RPMh will need access to cmd_db. Rather than having each >child have code to check if cmd_db is ready let's add the check to >RPMh. > >Suggested-by: Stephen Boyd >Signed-off-by: Douglas Anderson Acked-by: Lina Iyer >--- >This code is based upon v11 of Lina and Raju's RPMh series. > >With this we'll be able to remove this boilerplate code from >clk-rpmh.c and qcom-rpmh-regulator.c. Neither of these files has >landed upstream yet but patches are pretty far along. > > drivers/soc/qcom/rpmh-rsc.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > >diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c >index 144a058407c0..ad85523bdd3b 100644 >--- a/drivers/soc/qcom/rpmh-rsc.c >+++ b/drivers/soc/qcom/rpmh-rsc.c >@@ -18,6 +18,7 @@ > #include > #include > >+#include > #include > #include > >@@ -621,6 +622,18 @@ static int rpmh_rsc_probe(struct platform_device *pdev) > struct rsc_drv *drv; > int ret, irq; > >+ /* >+ * Even though RPMh doesn't directly use cmd-db, all of its children >+ * do. To avoid adding this check to our children we'll do it now. nit: Double space before To >+ */ >+ ret = cmd_db_ready(); >+ if (ret) { >+ if (ret != -EPROBE_DEFER) >+ dev_err(&pdev->dev, "Command DB not available (%d)\n", >+ ret); >+ return ret; >+ } >+ > drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL); > if (!drv) > return -ENOMEM; >-- >2.18.0.rc1.244.gcf134e6275-goog >