Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250180
b: refs/heads/master
c: 0e4e720
h: refs/heads/master
v: v3
  • Loading branch information
Florian Mickler authored and Mauro Carvalho Chehab committed May 20, 2011
1 parent 19943b2 commit ab996e3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ab22cbda6651db25d03052aa9ee9452b5eaa3edd
refs/heads/master: 0e4e7208e6b33816c457292ee771da3a5779027b
23 changes: 19 additions & 4 deletions trunk/drivers/media/dvb/dvb-usb/friio.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,20 @@ static u32 gl861_i2c_func(struct i2c_adapter *adapter)
return I2C_FUNC_I2C;
}


static int friio_ext_ctl(struct dvb_usb_adapter *adap,
u32 sat_color, int lnb_on)
{
int i;
int ret;
struct i2c_msg msg;
u8 buf[2];
u8 *buf;
u32 mask;
u8 lnb = (lnb_on) ? FRIIO_CTL_LNB : 0;

buf = kmalloc(2, GFP_KERNEL);
if (!buf)
return -ENOMEM;

msg.addr = 0x00;
msg.flags = 0;
msg.len = 2;
Expand Down Expand Up @@ -189,6 +192,7 @@ static int friio_ext_ctl(struct dvb_usb_adapter *adap,
buf[1] |= FRIIO_CTL_CLK;
ret += gl861_i2c_xfer(&adap->dev->i2c_adap, &msg, 1);

kfree(buf);
return (ret == 70);
}

Expand Down Expand Up @@ -219,11 +223,20 @@ static int friio_initialize(struct dvb_usb_device *d)
int ret;
int i;
int retry = 0;
u8 rbuf[2];
u8 wbuf[3];
u8 *rbuf, *wbuf;

deb_info("%s called.\n", __func__);

wbuf = kmalloc(3, GFP_KERNEL);
if (!wbuf)
return -ENOMEM;

rbuf = kmalloc(2, GFP_KERNEL);
if (!rbuf) {
kfree(wbuf);
return -ENOMEM;
}

/* use gl861_i2c_msg instead of gl861_i2c_xfer(), */
/* because the i2c device is not set up yet. */
wbuf[0] = 0x11;
Expand Down Expand Up @@ -358,6 +371,8 @@ static int friio_initialize(struct dvb_usb_device *d)
return 0;

error:
kfree(wbuf);
kfree(rbuf);
deb_info("%s:ret == %d\n", __func__, ret);
return -EIO;
}
Expand Down

0 comments on commit ab996e3

Please sign in to comment.