[media] dvb_usb_v2: use dynamic debugs
authorAntti Palosaari <crope@iki.fi>
Mon, 4 Jun 2012 23:55:34 +0000 (20:55 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 4 Aug 2012 10:56:26 +0000 (07:56 -0300)
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/dvb-usb/dvb_usb_common.h
drivers/media/dvb/dvb-usb/dvb_usb_dvb.c
drivers/media/dvb/dvb-usb/dvb_usb_init.c

index 2c73829f276436853ac6dbc52467e0cb0655ed29..3a092053d8238fd6ea5151aaacf5731b8ad0ee04 100644 (file)
 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,
index 095cac5ee0b112f99e3b9278dc99be5163ff7b06..d7c8340ec7068947ed4537616fb787d8b20c40fc 100644 (file)
@@ -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);
index 6e0903989484e93e3fdf74962a1bb2d6e428a56b..731d6403faf0289c4b196c62ec70193f63f14861 100644 (file)
@@ -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);
        }