summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/arm_scmi/sensors.c
diff options
context:
space:
mode:
authorCristian Marussi <cristian.marussi@arm.com>2022-03-30 17:05:31 +0200
committerSudeep Holla <sudeep.holla@arm.com>2022-04-28 11:47:19 +0200
commit4de1b36fae866c02f264f6bcda7a9a9e00ec5306 (patch)
treec53207fbfad90c723e4feac92e9ae62e274ce1a4 /drivers/firmware/arm_scmi/sensors.c
parentfirmware: arm_scmi: Fix sparse warnings in OPTEE transport driver (diff)
downloadlinux-4de1b36fae866c02f264f6bcda7a9a9e00ec5306.tar.xz
linux-4de1b36fae866c02f264f6bcda7a9a9e00ec5306.zip
firmware: arm_scmi: Make protocols initialisation fail on basic errors
Bail out of protocol initialisation routine early when basic information about protocol version and attributes could not be retrieved. Failing to act this way can lead to a successfully initialized SCMI protocol which is in fact not fully functional. Link: https://lore.kernel.org/r/20220330150551.2573938-3-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/arm_scmi/sensors.c')
-rw-r--r--drivers/firmware/arm_scmi/sensors.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/firmware/arm_scmi/sensors.c b/drivers/firmware/arm_scmi/sensors.c
index cdbb287bd8bc..f37ac9824a87 100644
--- a/drivers/firmware/arm_scmi/sensors.c
+++ b/drivers/firmware/arm_scmi/sensors.c
@@ -966,7 +966,9 @@ static int scmi_sensors_protocol_init(const struct scmi_protocol_handle *ph)
int ret;
struct sensors_info *sinfo;
- ph->xops->version_get(ph, &version);
+ ret = ph->xops->version_get(ph, &version);
+ if (ret)
+ return ret;
dev_dbg(ph->dev, "Sensor Version %d.%d\n",
PROTOCOL_REV_MAJOR(version), PROTOCOL_REV_MINOR(version));