aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2013-11-06 17:42:02 -0500
committerAlex Deucher <alexander.deucher@amd.com>2013-11-15 15:29:32 -0500
commitfae009d15a44e5f1d938340facf4b8bc7dc69a09 (patch)
treec338145b700b91839aaae362e983a50b2516c150 /drivers/gpu/drm/radeon
parent936b32643cb03dcb34ef5dab81970229b1cc2a33 (diff)
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
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r--drivers/gpu/drm/radeon/atombios_i2c.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_i2c.c b/drivers/gpu/drm/radeon/atombios_i2c.c
index deaf98cdca3a..0652ee0a2098 100644
--- a/drivers/gpu/drm/radeon/atombios_i2c.c
+++ b/drivers/gpu/drm/radeon/atombios_i2c.c
@@ -56,8 +56,10 @@ static int radeon_process_i2c_ch(struct radeon_i2c_chan *chan,
56 return -EINVAL; 56 return -EINVAL;
57 } 57 }
58 args.ucRegIndex = buf[0]; 58 args.ucRegIndex = buf[0];
59 if (num > 1) 59 if (num > 1) {
60 memcpy(&out, &buf[1], num - 1); 60 num--;
61 memcpy(&out, &buf[1], num);
62 }
61 args.lpI2CDataOut = cpu_to_le16(out); 63 args.lpI2CDataOut = cpu_to_le16(out);
62 } else { 64 } else {
63 if (num > ATOM_MAX_HW_I2C_READ) { 65 if (num > ATOM_MAX_HW_I2C_READ) {