Skip to content

Commit

Permalink
drm/nouveau/i2c: fix a bit of a thinko in nv_wri2cr helper functions
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Feb 20, 2013
1 parent f3ed104 commit eaa8e7a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/gpu/drm/nouveau/core/subdev/i2c/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit eaa8e7a

Please sign in to comment.