Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357520
b: refs/heads/master
c: 06eae25
h: refs/heads/master
v: v3
  • Loading branch information
Sean Young authored and Mauro Carvalho Chehab committed Feb 8, 2013
1 parent c440f7b commit cba90d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 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: db8ee1064c97879bff614d653158dff1894d2e37
refs/heads/master: 06eae25f162e2a0d9e60f0ad3ec3d14c738fbe68
18 changes: 6 additions & 12 deletions trunk/drivers/media/rc/redrat3.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,6 @@ struct redrat3_dev {
dma_addr_t dma_in;
dma_addr_t dma_out;

/* locks this structure */
struct mutex lock;

/* rx signal timeout timer */
struct timer_list rx_timeout;
u32 hw_timeout;
Expand Down Expand Up @@ -922,8 +919,7 @@ static int redrat3_transmit_ir(struct rc_dev *rcdev, unsigned *txbuf,
return -EAGAIN;
}

if (count > (RR3_DRIVER_MAXLENS * 2))
return -EINVAL;
count = min_t(unsigned, count, RR3_MAX_SIG_SIZE - RR3_TX_TRAILER_LEN);

/* rr3 will disable rc detector on transmit */
rr3->det_enabled = false;
Expand All @@ -936,24 +932,22 @@ static int redrat3_transmit_ir(struct rc_dev *rcdev, unsigned *txbuf,
}

for (i = 0; i < count; i++) {
cur_sample_len = redrat3_us_to_len(txbuf[i]);
for (lencheck = 0; lencheck < curlencheck; lencheck++) {
cur_sample_len = redrat3_us_to_len(txbuf[i]);
if (sample_lens[lencheck] == cur_sample_len)
break;
}
if (lencheck == curlencheck) {
cur_sample_len = redrat3_us_to_len(txbuf[i]);
rr3_dbg(dev, "txbuf[%d]=%u, pos %d, enc %u\n",
i, txbuf[i], curlencheck, cur_sample_len);
if (curlencheck < 255) {
if (curlencheck < RR3_DRIVER_MAXLENS) {
/* now convert the value to a proper
* rr3 value.. */
sample_lens[curlencheck] = cur_sample_len;
curlencheck++;
} else {
dev_err(dev, "signal too long\n");
ret = -EINVAL;
goto out;
count = i - 1;
break;
}
}
}
Expand Down Expand Up @@ -1087,6 +1081,7 @@ static struct rc_dev *redrat3_init_rc_dev(struct redrat3_dev *rr3)
rc->tx_ir = redrat3_transmit_ir;
rc->s_tx_carrier = redrat3_set_tx_carrier;
rc->driver_name = DRIVER_NAME;
rc->rx_resolution = US_TO_NS(2);
rc->map_name = RC_MAP_HAUPPAUGE;

ret = rc_register_device(rc);
Expand Down Expand Up @@ -1202,7 +1197,6 @@ static int redrat3_dev_probe(struct usb_interface *intf,
rr3->bulk_out_buf, ep_out->wMaxPacketSize,
(usb_complete_t)redrat3_write_bulk_callback, rr3);

mutex_init(&rr3->lock);
rr3->udev = udev;

redrat3_reset(rr3);
Expand Down

0 comments on commit cba90d4

Please sign in to comment.