There is no reason to call SMC from clock driver directly when clock driver
is a child of firmware driver which is providing it.

Signed-off-by: Michal Simek <michal.si...@amd.com>
---

 drivers/clk/clk_versal.c | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/drivers/clk/clk_versal.c b/drivers/clk/clk_versal.c
index cb98f34b5ecb..116dfc98f416 100644
--- a/drivers/clk/clk_versal.c
+++ b/drivers/clk/clk_versal.c
@@ -123,23 +123,12 @@ static unsigned int clock_max_idx __section(".data");
 
 static int versal_pm_query(struct versal_pm_query_data qdata, u32 *ret_payload)
 {
-       struct pt_regs regs;
-
-       regs.regs[0] = PM_SIP_SVC | PM_QUERY_DATA;
-       regs.regs[1] = ((u64)qdata.arg1 << 32) | qdata.qid;
-       regs.regs[2] = ((u64)qdata.arg3 << 32) | qdata.arg2;
-
-       smc_call(&regs);
+       int ret;
 
-       if (ret_payload) {
-               ret_payload[0] = (u32)regs.regs[0];
-               ret_payload[1] = upper_32_bits(regs.regs[0]);
-               ret_payload[2] = (u32)regs.regs[1];
-               ret_payload[3] = upper_32_bits(regs.regs[1]);
-               ret_payload[4] = (u32)regs.regs[2];
-       }
+       ret = smc_call_handler(PM_QUERY_DATA, qdata.qid, qdata.arg1, qdata.arg2,
+                              qdata.arg3, ret_payload);
 
-       return qdata.qid == PM_QID_CLOCK_GET_NAME ? 0 : regs.regs[0];
+       return qdata.qid == PM_QID_CLOCK_GET_NAME ? 0 : ret;
 }
 
 static inline int versal_is_valid_clock(u32 clk_id)
-- 
2.43.0

base-commit: a51b7dfc6fec0aa76367114af59a7114b040b090
branch: debian-sent3

Reply via email to