Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285746
b: refs/heads/master
c: f0e07d7
h: refs/heads/master
v: v3
  • Loading branch information
Malcolm Priestley authored and Mauro Carvalho Chehab committed Jan 6, 2012
1 parent 7f58220 commit 0511716
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 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: 6a2329ad1cb80b158a75bbf1901b86dc2deb88ee
refs/heads/master: f0e07d7658a81bc185b8ba58f062c16b79ac0e2b
9 changes: 7 additions & 2 deletions trunk/drivers/media/dvb/dvb-usb/it913x.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ static int it913x_download_firmware(struct usb_device *udev,
const struct firmware *fw)
{
int ret = 0, i = 0, pos = 0;
u8 packet_size;
u8 packet_size, min_pkt;
u8 *fw_data;

ret = it913x_wr_reg(udev, DEV_0, I2C_CLK, I2C_CLK_100);
Expand All @@ -570,11 +570,16 @@ static int it913x_download_firmware(struct usb_device *udev,
/* The firmware must start with 03 XX 00 */
/* and be the extact firmware length */

if (it913x_config.chip_ver == 2)
min_pkt = 0x11;
else
min_pkt = 0x19;

while (i <= fw->size) {
if (((fw->data[i] == 0x3) && (fw->data[i + 2] == 0x0))
|| (i == fw->size)) {
packet_size = i - pos;
if ((packet_size > 0x19) || (i == fw->size)) {
if ((packet_size > min_pkt) || (i == fw->size)) {
fw_data = (u8 *)(fw->data + pos);
pos += packet_size;
if (packet_size > 0)
Expand Down

0 comments on commit 0511716

Please sign in to comment.