radeon/i2c: do not count reg index in number of i2c byte we are writing.
Useless to count the register index in number of bytes we are writing. Fixes a regression with hw i2c enabled. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
This commit is contained in:
parent
936b32643c
commit
fae009d15a
@ -56,8 +56,10 @@ static int radeon_process_i2c_ch(struct radeon_i2c_chan *chan,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
args.ucRegIndex = buf[0];
|
args.ucRegIndex = buf[0];
|
||||||
if (num > 1)
|
if (num > 1) {
|
||||||
memcpy(&out, &buf[1], num - 1);
|
num--;
|
||||||
|
memcpy(&out, &buf[1], num);
|
||||||
|
}
|
||||||
args.lpI2CDataOut = cpu_to_le16(out);
|
args.lpI2CDataOut = cpu_to_le16(out);
|
||||||
} else {
|
} else {
|
||||||
if (num > ATOM_MAX_HW_I2C_READ) {
|
if (num > ATOM_MAX_HW_I2C_READ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user