* [PATCH v2] drivers: qcom: rpmh-rsc: Check cmd_db_ready() to help children
@ 2018-06-18 18:36 Douglas Anderson
0 siblings, 0 replies; only message in thread
From: Douglas Anderson @ 2018-06-18 18:36 UTC (permalink / raw)
To: andy.gross
Cc: tdas, collinsd, sboyd, ilina, broonie, rplsssn, Douglas Anderson,
linux-arm-msm, linux-soc, David Brown, linux-kernel
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.
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.
===
This code is based upon v11 of Lina and Raju's RPMh series.
Suggested-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Lina Iyer <ilina@codeaurora.org>
---
Changes in v2:
- 1 space after a period as per Lina
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..c0f9cec92b13 100644
--- a/drivers/soc/qcom/rpmh-rsc.c
+++ b/drivers/soc/qcom/rpmh-rsc.c
@@ -18,6 +18,7 @@
#include <linux/slab.h>
#include <linux/spinlock.h>
+#include <soc/qcom/cmd-db.h>
#include <soc/qcom/tcs.h>
#include <dt-bindings/soc/qcom,rpmh-rsc.h>
@@ -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.
+ */
+ 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-06-18 18:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-18 18:36 [PATCH v2] drivers: qcom: rpmh-rsc: Check cmd_db_ready() to help children Douglas Anderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®