diff options
Diffstat (limited to 'drivers/media/usb/dvb-usb/dtt200u.c')
| -rw-r--r-- | drivers/media/usb/dvb-usb/dtt200u.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/media/usb/dvb-usb/dtt200u.c b/drivers/media/usb/dvb-usb/dtt200u.c index 7706938b5167..f88572c7ae7c 100644 --- a/drivers/media/usb/dvb-usb/dtt200u.c +++ b/drivers/media/usb/dvb-usb/dtt200u.c | |||
| @@ -28,37 +28,42 @@ struct dtt200u_state { | |||
| 28 | static int dtt200u_power_ctrl(struct dvb_usb_device *d, int onoff) | 28 | static int dtt200u_power_ctrl(struct dvb_usb_device *d, int onoff) |
| 29 | { | 29 | { |
| 30 | struct dtt200u_state *st = d->priv; | 30 | struct dtt200u_state *st = d->priv; |
| 31 | int ret = 0; | ||
| 31 | 32 | ||
| 32 | mutex_lock(&st->data_mutex); | 33 | mutex_lock(&st->data_mutex); |
| 33 | 34 | ||
| 34 | st->data[0] = SET_INIT; | 35 | st->data[0] = SET_INIT; |
| 35 | 36 | ||
| 36 | if (onoff) | 37 | if (onoff) |
| 37 | dvb_usb_generic_write(d, st->data, 2); | 38 | ret = dvb_usb_generic_write(d, st->data, 2); |
| 38 | 39 | ||
| 39 | mutex_unlock(&st->data_mutex); | 40 | mutex_unlock(&st->data_mutex); |
| 40 | return 0; | 41 | return ret; |
| 41 | } | 42 | } |
| 42 | 43 | ||
| 43 | static int dtt200u_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) | 44 | static int dtt200u_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) |
| 44 | { | 45 | { |
| 45 | struct dtt200u_state *st = adap->dev->priv; | 46 | struct dtt200u_state *st = adap->dev->priv; |
| 47 | int ret; | ||
| 46 | 48 | ||
| 47 | mutex_lock(&st->data_mutex); | 49 | mutex_lock(&st->data_mutex); |
| 48 | st->data[0] = SET_STREAMING; | 50 | st->data[0] = SET_STREAMING; |
| 49 | st->data[1] = onoff; | 51 | st->data[1] = onoff; |
| 50 | 52 | ||
| 51 | dvb_usb_generic_write(adap->dev, st->data, 2); | 53 | ret = dvb_usb_generic_write(adap->dev, st->data, 2); |
| 54 | if (ret < 0) | ||
| 55 | goto ret; | ||
| 52 | 56 | ||
| 53 | if (onoff) | 57 | if (onoff) |
| 54 | return 0; | 58 | goto ret; |
| 55 | 59 | ||
| 56 | st->data[0] = RESET_PID_FILTER; | 60 | st->data[0] = RESET_PID_FILTER; |
| 57 | dvb_usb_generic_write(adap->dev, st->data, 1); | 61 | ret = dvb_usb_generic_write(adap->dev, st->data, 1); |
| 58 | 62 | ||
| 63 | ret: | ||
| 59 | mutex_unlock(&st->data_mutex); | 64 | mutex_unlock(&st->data_mutex); |
| 60 | 65 | ||
| 61 | return 0; | 66 | return ret; |
| 62 | } | 67 | } |
| 63 | 68 | ||
| 64 | static int dtt200u_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onoff) | 69 | static int dtt200u_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onoff) |
| @@ -84,11 +89,15 @@ static int dtt200u_rc_query(struct dvb_usb_device *d) | |||
| 84 | { | 89 | { |
| 85 | struct dtt200u_state *st = d->priv; | 90 | struct dtt200u_state *st = d->priv; |
| 86 | u32 scancode; | 91 | u32 scancode; |
| 92 | int ret; | ||
| 87 | 93 | ||
| 88 | mutex_lock(&st->data_mutex); | 94 | mutex_lock(&st->data_mutex); |
| 89 | st->data[0] = GET_RC_CODE; | 95 | st->data[0] = GET_RC_CODE; |
| 90 | 96 | ||
| 91 | dvb_usb_generic_rw(d, st->data, 1, st->data, 5, 0); | 97 | ret = dvb_usb_generic_rw(d, st->data, 1, st->data, 5, 0); |
| 98 | if (ret < 0) | ||
| 99 | goto ret; | ||
| 100 | |||
| 92 | if (st->data[0] == 1) { | 101 | if (st->data[0] == 1) { |
| 93 | enum rc_type proto = RC_TYPE_NEC; | 102 | enum rc_type proto = RC_TYPE_NEC; |
| 94 | 103 | ||
| @@ -116,8 +125,9 @@ static int dtt200u_rc_query(struct dvb_usb_device *d) | |||
| 116 | if (st->data[0] != 0) | 125 | if (st->data[0] != 0) |
| 117 | deb_info("st->data: %*ph\n", 5, st->data); | 126 | deb_info("st->data: %*ph\n", 5, st->data); |
| 118 | 127 | ||
| 128 | ret: | ||
| 119 | mutex_unlock(&st->data_mutex); | 129 | mutex_unlock(&st->data_mutex); |
| 120 | return 0; | 130 | return ret; |
| 121 | } | 131 | } |
| 122 | 132 | ||
| 123 | static int dtt200u_frontend_attach(struct dvb_usb_adapter *adap) | 133 | static int dtt200u_frontend_attach(struct dvb_usb_adapter *adap) |
