diff options
author | Cristian Marussi <cristian.marussi@arm.com> | 2022-03-30 17:05:41 +0200 |
---|---|---|
committer | Sudeep Holla <sudeep.holla@arm.com> | 2022-04-28 19:22:52 +0200 |
commit | df3576d14a4598534d1a28276ded5ba2545d5e4c (patch) | |
tree | 8cdf42198528de75462cfd6fa7f1d09a0ce2cefa /drivers/firmware | |
parent | firmware: arm_scmi: Set clock latency to U32_MAX if it is not supported (diff) | |
download | linux-df3576d14a4598534d1a28276ded5ba2545d5e4c.tar.xz linux-df3576d14a4598534d1a28276ded5ba2545d5e4c.zip |
firmware: arm_scmi: Parse clock_enable_latency conditionally
The clock_enable_latency field in CLOCK_ATTRIBUTES response message has
been added only since SCMI v3.1. Use the advertised SCMI clock protocol
version as a proper condition check for parsing it, instead of the bare
message length lookup.
Link: https://lore.kernel.org/r/20220330150551.2573938-13-cristian.marussi@arm.com
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/arm_scmi/clock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/firmware/arm_scmi/clock.c b/drivers/firmware/arm_scmi/clock.c index 81f739700893..cf26f18b85fc 100644 --- a/drivers/firmware/arm_scmi/clock.c +++ b/drivers/firmware/arm_scmi/clock.c @@ -132,8 +132,8 @@ static int scmi_clock_attributes_get(const struct scmi_protocol_handle *ph, u32 latency = 0; attributes = le32_to_cpu(attr->attributes); strlcpy(clk->name, attr->name, SCMI_MAX_STR_SIZE); - /* Is optional field clock_enable_latency provided ? */ - if (t->rx.len == sizeof(*attr)) + /* clock_enable_latency field is present only since SCMI v3.1 */ + if (PROTOCOL_REV_MAJOR(version) >= 0x2) latency = le32_to_cpu(attr->clock_enable_latency); clk->enable_latency = latency ? : U32_MAX; } |