Commit 54d577a4 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] cinergyT2-core: handle error code on RC query

There's no sense on decoding and generating a RC key code if
there was an error on the URB control message.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 5ef8ed0e
...@@ -102,7 +102,7 @@ static int cinergyt2_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -102,7 +102,7 @@ static int cinergyt2_frontend_attach(struct dvb_usb_adapter *adap)
/* Copy this pointer as we are gonna need it in the release phase */ /* Copy this pointer as we are gonna need it in the release phase */
cinergyt2_usb_device = adap->dev; cinergyt2_usb_device = adap->dev;
return 0; return ret;
} }
static struct rc_map_table rc_map_cinergyt2_table[] = { static struct rc_map_table rc_map_cinergyt2_table[] = {
...@@ -162,14 +162,16 @@ static int repeatable_keys[] = { ...@@ -162,14 +162,16 @@ static int repeatable_keys[] = {
static int cinergyt2_rc_query(struct dvb_usb_device *d, u32 *event, int *state) static int cinergyt2_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
{ {
struct cinergyt2_state *st = d->priv; struct cinergyt2_state *st = d->priv;
int i; int i, ret;
*state = REMOTE_NO_KEY_PRESSED; *state = REMOTE_NO_KEY_PRESSED;
mutex_lock(&st->data_mutex); mutex_lock(&st->data_mutex);
st->data[0] = CINERGYT2_EP1_GET_RC_EVENTS; st->data[0] = CINERGYT2_EP1_GET_RC_EVENTS;
dvb_usb_generic_rw(d, st->data, 1, st->data, 5, 0); ret = dvb_usb_generic_rw(d, st->data, 1, st->data, 5, 0);
if (ret < 0)
goto ret;
if (st->data[4] == 0xff) { if (st->data[4] == 0xff) {
/* key repeat */ /* key repeat */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment