if (ret < 0) {
pr_err("%s: error while stopping stream\n",
KBUILD_MODNAME);
- return ret;
+ goto err_mutex_unlock;
}
}
+ mutex_unlock(&adap->sync_mutex);
}
adap->feedcount = newfeedcount;
adap->props->pid_filter(adap, dvbdmxfeed->index,
dvbdmxfeed->pid, onoff);
- /* start the feed if this was the first feed and there is still a feed
+ /*
+ * Start the feed if this was the first feed and there is still a feed
* for reception.
*/
if (adap->feedcount == onoff && adap->feedcount > 0) {
struct usb_data_stream_properties stream_props;
unsigned int ts_props;
+ mutex_lock(&adap->sync_mutex);
/* resolve TS configuration */
if (adap->dev->props->get_ts_config) {
adap->fe[adap->active_fe],
&ts_props);
if (ret < 0)
- return ret;
+ goto err_mutex_unlock;
} else {
ts_props = 0; /* normal 188 payload only TS */
}
adap->fe[adap->active_fe],
&stream_props);
if (ret < 0)
- return ret;
+ goto err_mutex_unlock;
} else {
stream_props = adap->props->stream;
}
pr_debug("%s: submitting all URBs\n", __func__);
-
usb_urb_submitv2(&adap->stream, &stream_props);
pr_debug("%s: controlling pid parser\n", __func__);
if (ret < 0) {
pr_err("%s: could not handle pid_parser\n",
KBUILD_MODNAME);
- return ret;
+ goto err_mutex_unlock;
}
}
pr_debug("%s: start feeding\n", __func__);
if (ret < 0) {
pr_err("%s: error while enabling fifo\n",
KBUILD_MODNAME);
- return ret;
+ goto err_mutex_unlock;
}
}
}
+
return 0;
+err_mutex_unlock:
+ mutex_unlock(&adap->sync_mutex);
err:
pr_debug("%s: failed=%d\n", __func__, ret);
return ret;
goto err_net_init;
}
+ mutex_init(&adap->sync_mutex);
adap->state |= DVB_USB_ADAP_STATE_DVB;
return 0;
{
int ret;
struct dvb_usb_adapter *adap = fe->dvb->priv;
+ mutex_lock(&adap->sync_mutex);
pr_debug("%s: adap=%d fe=%d\n", __func__, adap->id, fe->id);
ret = dvb_usbv2_device_power_ctrl(adap->dev, 1);
}
adap->active_fe = fe->id;
+ mutex_unlock(&adap->sync_mutex);
return 0;
err:
+ mutex_unlock(&adap->sync_mutex);
pr_debug("%s: failed=%d\n", __func__, ret);
return ret;
}
{
int ret;
struct dvb_usb_adapter *adap = fe->dvb->priv;
+ mutex_lock(&adap->sync_mutex);
pr_debug("%s: adap=%d fe=%d\n", __func__, adap->id, fe->id);
if (adap->fe_sleep[fe->id]) {
goto err;
adap->active_fe = -1;
+ mutex_unlock(&adap->sync_mutex);
return 0;
err:
+ mutex_unlock(&adap->sync_mutex);
pr_debug("%s: failed=%d\n", __func__, ret);
return ret;
}