Commit 19ec2728 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] dvb_usb_v2: use dynamic debugs

Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 0359b5fa
...@@ -15,19 +15,10 @@ ...@@ -15,19 +15,10 @@
extern int dvb_usb_debug; extern int dvb_usb_debug;
extern int dvb_usb_disable_rc_polling; extern int dvb_usb_disable_rc_polling;
#define deb_info(args...) dprintk(dvb_usb_debug, 0x001, args)
#define deb_xfer(args...) dprintk(dvb_usb_debug, 0x002, args) #define deb_xfer(args...) dprintk(dvb_usb_debug, 0x002, args)
#define deb_pll(args...) dprintk(dvb_usb_debug, 0x004, args)
#define deb_ts(args...) dprintk(dvb_usb_debug, 0x008, args)
#define deb_err(args...) dprintk(dvb_usb_debug, 0x010, args)
#define deb_rc(args...) dprintk(dvb_usb_debug, 0x020, args)
#define deb_fw(args...) dprintk(dvb_usb_debug, 0x040, args)
#define deb_mem(args...) dprintk(dvb_usb_debug, 0x080, args)
#define deb_uxfer(args...) dprintk(dvb_usb_debug, 0x100, args) #define deb_uxfer(args...) dprintk(dvb_usb_debug, 0x100, args)
/* commonly used methods */ /* commonly used methods */
extern int dvb_usb_download_firmware(struct dvb_usb_device *);
extern int dvb_usb_device_power_ctrl(struct dvb_usb_device *d, int onoff); extern int dvb_usb_device_power_ctrl(struct dvb_usb_device *d, int onoff);
extern int usb_urb_init(struct usb_data_stream *stream, extern int usb_urb_init(struct usb_data_stream *stream,
......
...@@ -80,7 +80,7 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) ...@@ -80,7 +80,7 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
/* stop feed before setting a new pid if there will be no pid anymore */ /* stop feed before setting a new pid if there will be no pid anymore */
if (newfeedcount == 0) { if (newfeedcount == 0) {
deb_ts("stop feeding\n"); pr_debug("%s: stop feeding\n", __func__);
usb_urb_kill(&adap->stream); usb_urb_kill(&adap->stream);
if (adap->props.streaming_ctrl != NULL) { if (adap->props.streaming_ctrl != NULL) {
...@@ -95,10 +95,10 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) ...@@ -95,10 +95,10 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
adap->feedcount = newfeedcount; adap->feedcount = newfeedcount;
/* activate the pid on the device specific pid_filter */ /* activate the pid on the device specific pid_filter */
deb_ts("setting pid (%s): %5d %04x at index %d '%s'\n", pr_debug("%s: setting pid (%s): %5d %04x at index %d '%s'\n", __func__,
adap->pid_filtering ? adap->pid_filtering ? "yes" : "no", dvbdmxfeed->pid,
"yes" : "no", dvbdmxfeed->pid, dvbdmxfeed->pid, dvbdmxfeed->pid, dvbdmxfeed->index,
dvbdmxfeed->index, onoff ? "on" : "off"); onoff ? "on" : "off");
if (adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER && if (adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER &&
adap->pid_filtering && adap->pid_filtering &&
adap->props.pid_filter != NULL) adap->props.pid_filter != NULL)
...@@ -141,23 +141,23 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) ...@@ -141,23 +141,23 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
stream_props = adap->props.stream; stream_props = adap->props.stream;
} }
deb_ts("submitting all URBs\n"); pr_debug("%s: submitting all URBs\n", __func__);
usb_urb_submit(&adap->stream, &stream_props); usb_urb_submit(&adap->stream, &stream_props);
deb_ts("controlling pid parser\n"); pr_debug("%s: controlling pid parser\n", __func__);
if (adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER && if (adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER &&
adap->props.caps & adap->props.caps &
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF && DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF &&
adap->props.pid_filter_ctrl != NULL) { adap->props.pid_filter_ctrl != NULL) {
ret = adap->props.pid_filter_ctrl( ret = adap->props.pid_filter_ctrl(adap,
adap, adap->pid_filtering);
adap->pid_filtering);
if (ret < 0) { if (ret < 0) {
err("could not handle pid_parser"); err("could not handle pid_parser");
return ret; return ret;
} }
} }
deb_ts("start feeding\n"); pr_debug("%s: start feeding\n", __func__);
if (adap->props.streaming_ctrl != NULL) { if (adap->props.streaming_ctrl != NULL) {
ret = adap->props.streaming_ctrl(adap, 1); ret = adap->props.streaming_ctrl(adap, 1);
if (ret < 0) { if (ret < 0) {
...@@ -172,15 +172,15 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) ...@@ -172,15 +172,15 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
static int dvb_usb_start_feed(struct dvb_demux_feed *dvbdmxfeed) static int dvb_usb_start_feed(struct dvb_demux_feed *dvbdmxfeed)
{ {
deb_ts("start pid: 0x%04x, feedtype: %d\n", pr_debug("%s: start pid %04x feedtype %d", __func__, dvbdmxfeed->pid,
dvbdmxfeed->pid, dvbdmxfeed->type); dvbdmxfeed->type);
return dvb_usb_ctrl_feed(dvbdmxfeed, 1); return dvb_usb_ctrl_feed(dvbdmxfeed, 1);
} }
static int dvb_usb_stop_feed(struct dvb_demux_feed *dvbdmxfeed) static int dvb_usb_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
{ {
deb_ts("stop pid: 0x%04x, feedtype: %d\n", pr_debug("%s: stop pid %04x feedtype %d", __func__, dvbdmxfeed->pid,
dvbdmxfeed->pid, dvbdmxfeed->type); dvbdmxfeed->type);
return dvb_usb_ctrl_feed(dvbdmxfeed, 0); return dvb_usb_ctrl_feed(dvbdmxfeed, 0);
} }
...@@ -191,7 +191,7 @@ int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap) ...@@ -191,7 +191,7 @@ int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap)
&adap->dev->udev->dev, &adap->dev->udev->dev,
adap->dev->props.adapter_nr); adap->dev->props.adapter_nr);
if (ret < 0) { if (ret < 0) {
deb_info("dvb_register_adapter failed: error %d", ret); pr_debug("%s: dvb_register_adapter failed=%d\n", __func__, ret);
goto err; goto err;
} }
adap->dvb_adap.priv = adap; adap->dvb_adap.priv = adap;
...@@ -253,7 +253,7 @@ int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap) ...@@ -253,7 +253,7 @@ int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap)
int dvb_usb_adapter_dvb_exit(struct dvb_usb_adapter *adap) int dvb_usb_adapter_dvb_exit(struct dvb_usb_adapter *adap)
{ {
if (adap->state & DVB_USB_ADAP_STATE_DVB) { if (adap->state & DVB_USB_ADAP_STATE_DVB) {
deb_info("unregistering DVB part\n"); pr_debug("%s: unregistering DVB part\n", __func__);
dvb_net_release(&adap->dvb_net); dvb_net_release(&adap->dvb_net);
adap->demux.dmx.close(&adap->demux.dmx); adap->demux.dmx.close(&adap->demux.dmx);
dvb_dmxdev_release(&adap->dmxdev); dvb_dmxdev_release(&adap->dmxdev);
......
...@@ -189,11 +189,11 @@ static int dvb_usb_adapter_exit(struct dvb_usb_device *d) ...@@ -189,11 +189,11 @@ static int dvb_usb_adapter_exit(struct dvb_usb_device *d)
/* general initialization functions */ /* general initialization functions */
static int dvb_usb_exit(struct dvb_usb_device *d) static int dvb_usb_exit(struct dvb_usb_device *d)
{ {
deb_info("state before exiting everything: %x\n", d->state); pr_debug("%s: state before exiting everything: %x\n", __func__, d->state);
dvb_usb_remote_exit(d); dvb_usb_remote_exit(d);
dvb_usb_adapter_exit(d); dvb_usb_adapter_exit(d);
dvb_usb_i2c_exit(d); dvb_usb_i2c_exit(d);
deb_info("state should be zero now: %x\n", d->state); pr_debug("%s: state should be zero now: %x\n", __func__, d->state);
d->state = DVB_USB_STATE_INIT; d->state = DVB_USB_STATE_INIT;
kfree(d->priv); kfree(d->priv);
kfree(d); kfree(d);
...@@ -249,7 +249,7 @@ int dvb_usb_device_power_ctrl(struct dvb_usb_device *d, int onoff) ...@@ -249,7 +249,7 @@ int dvb_usb_device_power_ctrl(struct dvb_usb_device *d, int onoff)
if (d->powered == 0 || (onoff && d->powered == 1)) { if (d->powered == 0 || (onoff && d->powered == 1)) {
/* when switching from 1 to 0 or from 0 to 1 */ /* when switching from 1 to 0 or from 0 to 1 */
deb_info("power control: %d\n", onoff); pr_debug("%s: power control: %d\n", __func__, onoff);
if (d->props.power_ctrl) if (d->props.power_ctrl)
return d->props.power_ctrl(d, onoff); return d->props.power_ctrl(d, onoff);
} }
......
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