aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBen Skeggs2013-02-14 19:54:42 -0500
committerBen Skeggs2013-02-20 16:00:58 +1000
commiteaa8e7ab99d1b33db9362f35c1d65df8df39dea9 (patch)
tree7a4e919be10818c3617198acb0f2ee1188aab04e /drivers/gpu
parentf3ed1048715f2edc10c4dda6148b60e93f6282ed (diff)
drm/nouveau/i2c: fix a bit of a thinko in nv_wri2cr helper functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/i2c/base.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c b/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c
index 1ee53d3cbd01..e09af329120e 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/i2c/base.c
@@ -46,13 +46,13 @@ nv_rdi2cr(struct nouveau_i2c_port *port, u8 addr, u8 reg)
int
nv_wri2cr(struct nouveau_i2c_port *port, u8 addr, u8 reg, u8 val)
{
+ u8 buf[2] = { reg, val };
struct i2c_msg msgs[] = {
- { .addr = addr, .flags = 0, .len = 1, .buf = &reg },
- { .addr = addr, .flags = 0, .len = 1, .buf = &val },
+ { .addr = addr, .flags = 0, .len = 2, .buf = buf },
};
- int ret = i2c_transfer(&port->adapter, msgs, 2);
- if (ret != 2)
+ int ret = i2c_transfer(&port->adapter, msgs, 1);
+ if (ret != 1)
return -EIO;
return 0;