Message ID | 663deed4-fbbb-20ad-1943-dbd4e66e797f@arm.com |
---|---|
State | Accepted |
Commit | a766347b15c01507db9bf01f9b7021be5a776691 |
Headers | show |
diff --git i/drivers/firmware/arm_scpi.c w/drivers/firmware/arm_scpi.c index 70e13230d8db..04aa873205e9 100644 --- i/drivers/firmware/arm_scpi.c +++ w/drivers/firmware/arm_scpi.c @@ -721,11 +721,15 @@ static int scpi_sensor_get_value(u16 sensor, u64 *val) ret = scpi_send_message(CMD_SENSOR_VALUE, &id, sizeof(id), &buf, sizeof(buf)); - if (!ret) + if (ret) + return ret; + + if (scpi_info->is_legacy) /* 32-bits supported, hi_val can be junk */ + *val = le32_to_cpu(buf.lo_val); + else *val = (u64)le32_to_cpu(buf.hi_val) << 32 | le32_to_cpu(buf.lo_val); - - return ret; + return 0; }