Commit 2d762340 authored by Jerome Glisse's avatar Jerome Glisse Committed by Greg Kroah-Hartman

radeon/i2c: do not count reg index in number of i2c byte we are writing.

commit fae009d1 upstream.

Useless to count the register index in number of bytes we are writing.

Fixes a regression with hw i2c enabled.
Signed-off-by: default avatarJerome Glisse <jglisse@redhat.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 356a1040
......@@ -56,8 +56,10 @@ static int radeon_process_i2c_ch(struct radeon_i2c_chan *chan,
return -EINVAL;
}
args.ucRegIndex = buf[0];
if (num > 1)
memcpy(&out, &buf[1], num - 1);
if (num > 1) {
num--;
memcpy(&out, &buf[1], num);
}
args.lpI2CDataOut = cpu_to_le16(out);
} else {
if (num > ATOM_MAX_HW_I2C_READ) {
......
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