drm/nouveau/i2c: fix a bit of a thinko in nv_wri2cr helper functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
f3ed104871
commit
eaa8e7ab99
1 changed files with 4 additions and 4 deletions
|
@ -46,13 +46,13 @@ nv_rdi2cr(struct nouveau_i2c_port *port, u8 addr, u8 reg)
|
||||||
int
|
int
|
||||||
nv_wri2cr(struct nouveau_i2c_port *port, u8 addr, u8 reg, u8 val)
|
nv_wri2cr(struct nouveau_i2c_port *port, u8 addr, u8 reg, u8 val)
|
||||||
{
|
{
|
||||||
|
u8 buf[2] = { reg, val };
|
||||||
struct i2c_msg msgs[] = {
|
struct i2c_msg msgs[] = {
|
||||||
{ .addr = addr, .flags = 0, .len = 1, .buf = ® },
|
{ .addr = addr, .flags = 0, .len = 2, .buf = buf },
|
||||||
{ .addr = addr, .flags = 0, .len = 1, .buf = &val },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int ret = i2c_transfer(&port->adapter, msgs, 2);
|
int ret = i2c_transfer(&port->adapter, msgs, 1);
|
||||||
if (ret != 2)
|
if (ret != 1)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue