firmware: arm_scmi: Stash version in protocol init functions
In order to avoid querying the individual protocol versions multiple time with more that one device created for each protocol, we can simple store the copy in the protocol specific private data and use them whenever required. Reviewed-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
This commit is contained in:
@@ -65,6 +65,7 @@ struct scmi_clock_set_rate {
|
||||
};
|
||||
|
||||
struct clock_info {
|
||||
u32 version;
|
||||
int num_clocks;
|
||||
int max_async_req;
|
||||
atomic_t cur_async_req;
|
||||
@@ -340,6 +341,7 @@ static int scmi_clock_protocol_init(struct scmi_handle *handle)
|
||||
scmi_clock_describe_rates_get(handle, clkid, clk);
|
||||
}
|
||||
|
||||
cinfo->version = version;
|
||||
handle->clk_ops = &clk_ops;
|
||||
handle->clk_priv = cinfo;
|
||||
|
||||
|
Reference in New Issue
Block a user