Commit 25d95071 authored by Axel Lin's avatar Axel Lin Committed by Samuel Ortiz

mfd: Remove unneeded ret value checking for max8998 register updates

i2c_smbus_write_byte_data() returns zero or negative value,
therefore no need to check if ret is greater than zero or not.
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 1558b51e
...@@ -110,8 +110,6 @@ int max8998_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask) ...@@ -110,8 +110,6 @@ int max8998_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask)
u8 old_val = ret & 0xff; u8 old_val = ret & 0xff;
u8 new_val = (val & mask) | (old_val & (~mask)); u8 new_val = (val & mask) | (old_val & (~mask));
ret = i2c_smbus_write_byte_data(i2c, reg, new_val); ret = i2c_smbus_write_byte_data(i2c, reg, new_val);
if (ret >= 0)
ret = 0;
} }
mutex_unlock(&max8998->iolock); mutex_unlock(&max8998->iolock);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment