Skip to content

Commit

Permalink
hwmon: (pmbus) Use device specific function to read fan configuration
Browse files Browse the repository at this point in the history
Fan control implementation tends to be device specific, so start using
the device specific function call to read fan configuration registers.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Tom Grennan <tom.grennan@ericsson.com>
  • Loading branch information
Guenter Roeck committed May 19, 2011
1 parent 2cfa6ae commit 6586b14
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/hwmon/pmbus_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1295,17 +1295,15 @@ static void pmbus_add_fan_attributes(struct i2c_client *client,
break;

if (!pmbus_check_word_register(client, page,
pmbus_fan_registers[f])
|| !pmbus_check_byte_register(client, page,
pmbus_fan_config_registers[f]))
pmbus_fan_registers[f]))
break;

/*
* Skip fan if not installed.
* Each fan configuration register covers multiple fans,
* so we have to do some magic.
*/
regval = pmbus_read_byte_data(client, page,
regval = _pmbus_read_byte_data(client, page,
pmbus_fan_config_registers[f]);
if (regval < 0 ||
(!(regval & (PB_FAN_1_INSTALLED >> ((f & 1) * 4)))))
Expand Down

0 comments on commit 6586b14

Please sign in to comment.