diff options
| author | Etienne Carriere <[email protected]> | 2022-02-21 09:22:40 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2022-03-02 17:42:06 -0500 |
| commit | 6983710a31a0d6fb782eb0ea18b9325e4075f4c3 (patch) | |
| tree | 41db4e7af39822d4ab89a2eb18326d12475f9da9 /drivers/clk/clk_scmi.c | |
| parent | 41d62e2f275c44fd47bcd6d856608528006b082b (diff) | |
scmi: change parameter dev in devm_scmi_process_msg
Changes devm_scmi_process_msg() first argument from target parent device
to current SCMI device and lookup the SCMI agent device among SCMI device
parents for find the SCMI agent operator needed for communication with
the firmware.
This change is needed in order to support CCF in clk_scmi driver unless
what CCF will fail to find the right udevice related to exposed SCMI
clocks.
This patch allows to simplify the caller sequence, using SCMI device
reference as parameter instead of knowing SCMI uclass topology. This
change also adds some protection in case devm_scmi_process_msg() API
function is called for an invalid device type.
Cc: Lukasz Majewski <[email protected]>
Cc: Sean Anderson <[email protected]>
Cc: Jaehoon Chung <[email protected]>
Cc: Patrick Delaunay <[email protected]>
Reviewed-by: Patrick Delaunay <[email protected]>
Signed-off-by: Etienne Carriere <[email protected]>
Diffstat (limited to 'drivers/clk/clk_scmi.c')
| -rw-r--r-- | drivers/clk/clk_scmi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/clk/clk_scmi.c b/drivers/clk/clk_scmi.c index 9a0a6f66434..42fbab0d21b 100644 --- a/drivers/clk/clk_scmi.c +++ b/drivers/clk/clk_scmi.c @@ -24,7 +24,7 @@ static int scmi_clk_gate(struct clk *clk, int enable) in, out); int ret; - ret = devm_scmi_process_msg(clk->dev->parent, &msg); + ret = devm_scmi_process_msg(clk->dev, &msg); if (ret) return ret; @@ -52,7 +52,7 @@ static ulong scmi_clk_get_rate(struct clk *clk) in, out); int ret; - ret = devm_scmi_process_msg(clk->dev->parent, &msg); + ret = devm_scmi_process_msg(clk->dev, &msg); if (ret < 0) return ret; @@ -77,7 +77,7 @@ static ulong scmi_clk_set_rate(struct clk *clk, ulong rate) in, out); int ret; - ret = devm_scmi_process_msg(clk->dev->parent, &msg); + ret = devm_scmi_process_msg(clk->dev, &msg); if (ret < 0) return ret; |
