From: Antti Palosaari Date: Mon, 4 Jun 2012 23:55:34 +0000 (-0300) Subject: [media] dvb_usb_v2: use dynamic debugs X-Git-Tag: firefly_0821_release~3680^2~275^2~1685 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=19ec2728d77e75b9f44188f356f5ca2f6d7ff165;p=firefly-linux-kernel-4.4.55.git [media] dvb_usb_v2: use dynamic debugs Signed-off-by: Antti Palosaari Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/dvb-usb/dvb_usb_common.h b/drivers/media/dvb/dvb-usb/dvb_usb_common.h index 2c73829f2764..3a092053d823 100644 --- a/drivers/media/dvb/dvb-usb/dvb_usb_common.h +++ b/drivers/media/dvb/dvb-usb/dvb_usb_common.h @@ -15,19 +15,10 @@ extern int dvb_usb_debug; 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_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) /* 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 usb_urb_init(struct usb_data_stream *stream, diff --git a/drivers/media/dvb/dvb-usb/dvb_usb_dvb.c b/drivers/media/dvb/dvb-usb/dvb_usb_dvb.c index 095cac5ee0b1..d7c8340ec706 100644 --- a/drivers/media/dvb/dvb-usb/dvb_usb_dvb.c +++ b/drivers/media/dvb/dvb-usb/dvb_usb_dvb.c @@ -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 */ if (newfeedcount == 0) { - deb_ts("stop feeding\n"); + pr_debug("%s: stop feeding\n", __func__); usb_urb_kill(&adap->stream); if (adap->props.streaming_ctrl != NULL) { @@ -95,10 +95,10 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) adap->feedcount = newfeedcount; /* activate the pid on the device specific pid_filter */ - deb_ts("setting pid (%s): %5d %04x at index %d '%s'\n", - adap->pid_filtering ? - "yes" : "no", dvbdmxfeed->pid, dvbdmxfeed->pid, - dvbdmxfeed->index, onoff ? "on" : "off"); + pr_debug("%s: setting pid (%s): %5d %04x at index %d '%s'\n", __func__, + adap->pid_filtering ? "yes" : "no", dvbdmxfeed->pid, + dvbdmxfeed->pid, dvbdmxfeed->index, + onoff ? "on" : "off"); if (adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER && adap->pid_filtering && adap->props.pid_filter != NULL) @@ -141,23 +141,23 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) 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); - deb_ts("controlling pid parser\n"); + pr_debug("%s: controlling pid parser\n", __func__); if (adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER && - adap->props.caps & - DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF && - adap->props.pid_filter_ctrl != NULL) { - ret = adap->props.pid_filter_ctrl( - adap, - adap->pid_filtering); + adap->props.caps & + DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF && + adap->props.pid_filter_ctrl != NULL) { + ret = adap->props.pid_filter_ctrl(adap, + adap->pid_filtering); if (ret < 0) { err("could not handle pid_parser"); return ret; } } - deb_ts("start feeding\n"); + pr_debug("%s: start feeding\n", __func__); if (adap->props.streaming_ctrl != NULL) { ret = adap->props.streaming_ctrl(adap, 1); if (ret < 0) { @@ -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) { - deb_ts("start pid: 0x%04x, feedtype: %d\n", - dvbdmxfeed->pid, dvbdmxfeed->type); + pr_debug("%s: start pid %04x feedtype %d", __func__, dvbdmxfeed->pid, + dvbdmxfeed->type); return dvb_usb_ctrl_feed(dvbdmxfeed, 1); } static int dvb_usb_stop_feed(struct dvb_demux_feed *dvbdmxfeed) { - deb_ts("stop pid: 0x%04x, feedtype: %d\n", - dvbdmxfeed->pid, dvbdmxfeed->type); + pr_debug("%s: stop pid %04x feedtype %d", __func__, dvbdmxfeed->pid, + dvbdmxfeed->type); return dvb_usb_ctrl_feed(dvbdmxfeed, 0); } @@ -191,7 +191,7 @@ int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap) &adap->dev->udev->dev, adap->dev->props.adapter_nr); 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; } adap->dvb_adap.priv = adap; @@ -253,7 +253,7 @@ err: int dvb_usb_adapter_dvb_exit(struct dvb_usb_adapter *adap) { 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); adap->demux.dmx.close(&adap->demux.dmx); dvb_dmxdev_release(&adap->dmxdev); diff --git a/drivers/media/dvb/dvb-usb/dvb_usb_init.c b/drivers/media/dvb/dvb-usb/dvb_usb_init.c index 6e0903989484..731d6403faf0 100644 --- a/drivers/media/dvb/dvb-usb/dvb_usb_init.c +++ b/drivers/media/dvb/dvb-usb/dvb_usb_init.c @@ -189,11 +189,11 @@ static int dvb_usb_adapter_exit(struct dvb_usb_device *d) /* general initialization functions */ 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_adapter_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; kfree(d->priv); kfree(d); @@ -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)) { /* 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) return d->props.power_ctrl(d, onoff); }