summaryrefslogtreecommitdiff
path: root/drivers/firmware/arm_scmi/sensors.c
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@arm.com>2019-11-22 17:48:40 +0300
committerSudeep Holla <sudeep.holla@arm.com>2019-12-24 14:35:49 +0300
commitb55b06b79445574fa031158fe2ae2946cde0d1b7 (patch)
treed1b5858432993dbfe6d52e549208e35aebd22e75 /drivers/firmware/arm_scmi/sensors.c
parent50872a94637b1e7c92b43280adb71dd8e30fd246 (diff)
downloadlinux-b55b06b79445574fa031158fe2ae2946cde0d1b7.tar.xz
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>
Diffstat (limited to 'drivers/firmware/arm_scmi/sensors.c')
-rw-r--r--drivers/firmware/arm_scmi/sensors.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/firmware/arm_scmi/sensors.c b/drivers/firmware/arm_scmi/sensors.c
index a400ea805fc2..eba61b9c1f53 100644
--- a/drivers/firmware/arm_scmi/sensors.c
+++ b/drivers/firmware/arm_scmi/sensors.c
@@ -68,6 +68,7 @@ struct scmi_msg_sensor_reading_get {
};
struct sensors_info {
+ u32 version;
int num_sensors;
int max_requests;
u64 reg_addr;
@@ -294,6 +295,7 @@ static int scmi_sensors_protocol_init(struct scmi_handle *handle)
scmi_sensor_description_get(handle, sinfo);
+ sinfo->version = version;
handle->sensor_ops = &sensor_ops;
handle->sensor_priv = sinfo;