summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2018-04-03 23:56:54 +0930
committerJoel Stanley <joel@jms.id.au>2019-03-20 15:13:32 +1030
commitc665f48076545f2fd474408bcbab5457f15608a4 (patch)
treedea822fdac743bd146640223050817079793eaa9
parentade8659868cc154466dc3fa768d9d55709e2f262 (diff)
downloadtalos-obmc-linux-c665f48076545f2fd474408bcbab5457f15608a4.tar.gz
talos-obmc-linux-c665f48076545f2fd474408bcbab5457f15608a4.zip
pmbus (core): Use driver callbacks in pmbus_get_fan_rate()
The driver may have overridden the pmbus_read_byte_data() callback, so make sure we use that to achieve expected behaviour. This helps in the MAX31785 case where we may need to perform a one-shot retry of transfers in the face of a failure. OpenBMC-Staging-Count: 6 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Reviewed-by: Eddie James <eajames@linux.vnet.ibm.com> Tested-by: George Keishing <gkeishin@in.ibm.com> Signed-off-by: Joel Stanley <joel@jms.id.au>
-rw-r--r--drivers/hwmon/pmbus/pmbus_core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index dc986d8fca20..7200e80235db 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -454,15 +454,15 @@ static int pmbus_get_fan_rate(struct i2c_client *client, int page, int id,
return s->data;
}
- config = pmbus_read_byte_data(client, page,
- pmbus_fan_config_registers[id]);
+ config = _pmbus_read_byte_data(client, page,
+ pmbus_fan_config_registers[id]);
if (config < 0)
return config;
have_rpm = !!(config & pmbus_fan_rpm_mask[id]);
if (want_rpm == have_rpm)
- return pmbus_read_word_data(client, page,
- pmbus_fan_command_registers[id]);
+ return _pmbus_read_word_data(client, page,
+ pmbus_fan_command_registers[id]);
/* Can't sensibly map between RPM and PWM, just return zero */
return 0;
OpenPOWER on IntegriCloud