Skip to content

Commit 7a750b3

Browse files
jbrun3tgroeck
authored andcommitted
hwmon: (pmbus/core) allow drivers to override WRITE_PROTECT
Use _pmbus_read_byte_data() rather than calling smbus directly to check the write protection status. This give a chance to device implementing write protection differently to report back on the actual write protection status. Signed-off-by: Jerome Brunet <[email protected]> Message-ID: <[email protected]> [groeck: Fix page parameter of _pmbus_read_byte_data()] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 544177f commit 7a750b3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/hwmon/pmbus/pmbus_core.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,9 +2719,7 @@ static int pmbus_init_common(struct i2c_client *client, struct pmbus_data *data,
27192719
* limit registers need to be disabled.
27202720
*/
27212721
if (!(data->flags & PMBUS_NO_WRITE_PROTECT)) {
2722-
pmbus_wait(client);
2723-
ret = i2c_smbus_read_byte_data(client, PMBUS_WRITE_PROTECT);
2724-
pmbus_update_ts(client, false);
2722+
ret = _pmbus_read_byte_data(client, -1, PMBUS_WRITE_PROTECT);
27252723

27262724
if (ret > 0 && (ret & PB_WP_ANY))
27272725
data->flags |= PMBUS_WRITE_PROTECTED | PMBUS_SKIP_STATUS_CHECK;

0 commit comments

Comments
 (0)