Revert "hwmon: (pmbus) Introduce and use write_byte_data callback"
This reverts commit cbbc2c6747
.
This commit is contained in:
parent
909ef4903f
commit
ac0f56f632
2 changed files with 3 additions and 23 deletions
|
@ -438,8 +438,6 @@ struct pmbus_driver_info {
|
||||||
int (*read_byte_data)(struct i2c_client *client, int page, int reg);
|
int (*read_byte_data)(struct i2c_client *client, int page, int reg);
|
||||||
int (*read_word_data)(struct i2c_client *client, int page, int phase,
|
int (*read_word_data)(struct i2c_client *client, int page, int phase,
|
||||||
int reg);
|
int reg);
|
||||||
int (*write_byte_data)(struct i2c_client *client, int page, int reg,
|
|
||||||
u8 byte);
|
|
||||||
int (*write_word_data)(struct i2c_client *client, int page, int reg,
|
int (*write_word_data)(struct i2c_client *client, int page, int reg,
|
||||||
u16 word);
|
u16 word);
|
||||||
int (*write_byte)(struct i2c_client *client, int page, u8 value);
|
int (*write_byte)(struct i2c_client *client, int page, u8 value);
|
||||||
|
|
|
@ -265,24 +265,6 @@ static int _pmbus_write_word_data(struct i2c_client *client, int page, int reg,
|
||||||
return pmbus_write_word_data(client, page, reg, word);
|
return pmbus_write_word_data(client, page, reg, word);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* _pmbus_write_byte_data() is similar to pmbus_write_byte_data(), but checks if
|
|
||||||
* a device specific mapping function exists and calls it if necessary.
|
|
||||||
*/
|
|
||||||
static int _pmbus_write_byte_data(struct i2c_client *client, int page, int reg, u8 value)
|
|
||||||
{
|
|
||||||
struct pmbus_data *data = i2c_get_clientdata(client);
|
|
||||||
const struct pmbus_driver_info *info = data->info;
|
|
||||||
int status;
|
|
||||||
|
|
||||||
if (info->write_byte_data) {
|
|
||||||
status = info->write_byte_data(client, page, reg, value);
|
|
||||||
if (status != -ENODATA)
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
return pmbus_write_byte_data(client, page, reg, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
int pmbus_update_fan(struct i2c_client *client, int page, int id,
|
int pmbus_update_fan(struct i2c_client *client, int page, int id,
|
||||||
u8 config, u8 mask, u16 command)
|
u8 config, u8 mask, u16 command)
|
||||||
{
|
{
|
||||||
|
@ -297,7 +279,7 @@ int pmbus_update_fan(struct i2c_client *client, int page, int id,
|
||||||
|
|
||||||
to = (from & ~mask) | (config & mask);
|
to = (from & ~mask) | (config & mask);
|
||||||
if (to != from) {
|
if (to != from) {
|
||||||
rv = _pmbus_write_byte_data(client, page,
|
rv = pmbus_write_byte_data(client, page,
|
||||||
pmbus_fan_config_registers[id], to);
|
pmbus_fan_config_registers[id], to);
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
return rv;
|
return rv;
|
||||||
|
@ -404,7 +386,7 @@ int pmbus_update_byte_data(struct i2c_client *client, int page, u8 reg,
|
||||||
tmp = (rv & ~mask) | (value & mask);
|
tmp = (rv & ~mask) | (value & mask);
|
||||||
|
|
||||||
if (tmp != rv)
|
if (tmp != rv)
|
||||||
rv = _pmbus_write_byte_data(client, page, reg, tmp);
|
rv = pmbus_write_byte_data(client, page, reg, tmp);
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
@ -917,7 +899,7 @@ static int pmbus_get_boolean(struct i2c_client *client, struct pmbus_boolean *b,
|
||||||
|
|
||||||
regval = status & mask;
|
regval = status & mask;
|
||||||
if (regval) {
|
if (regval) {
|
||||||
ret = _pmbus_write_byte_data(client, page, reg, regval);
|
ret = pmbus_write_byte_data(client, page, reg, regval);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto unlock;
|
goto unlock;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue