aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/ibmpex.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/hwmon/ibmpex.c b/drivers/hwmon/ibmpex.c
index 9c9cdb0685e4..db551d869feb 100644
--- a/drivers/hwmon/ibmpex.c
+++ b/drivers/hwmon/ibmpex.c
@@ -327,10 +327,14 @@ static int is_temp_sensor(const char *sensor_id, int len)
327 return 0; 327 return 0;
328} 328}
329 329
330static int power_sensor_multiplier(const char *sensor_id, int len) 330static int power_sensor_multiplier(struct ibmpex_bmc_data *data,
331 const char *sensor_id, int len)
331{ 332{
332 int i; 333 int i;
333 334
335 if (data->sensor_major == 2)
336 return 1000000;
337
334 for (i = PEX_SENSOR_TYPE_LEN; i < len - 1; i++) 338 for (i = PEX_SENSOR_TYPE_LEN; i < len - 1; i++)
335 if (!memcmp(&sensor_id[i], watt_sensor_sig, PEX_MULT_LEN)) 339 if (!memcmp(&sensor_id[i], watt_sensor_sig, PEX_MULT_LEN))
336 return 1000000; 340 return 1000000;
@@ -398,8 +402,9 @@ static int ibmpex_find_sensors(struct ibmpex_bmc_data *data)
398 num_power++; 402 num_power++;
399 sensor_counter = num_power; 403 sensor_counter = num_power;
400 data->sensors[i].multiplier = 404 data->sensors[i].multiplier =
401 power_sensor_multiplier(data->rx_msg_data, 405 power_sensor_multiplier(data,
402 data->rx_msg_len); 406 data->rx_msg_data,
407 data->rx_msg_len);
403 } else if (is_temp_sensor(data->rx_msg_data, 408 } else if (is_temp_sensor(data->rx_msg_data,
404 data->rx_msg_len)) { 409 data->rx_msg_len)) {
405 sensor_type = TEMP_SENSOR; 410 sensor_type = TEMP_SENSOR;