aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-dvb.c
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-03-07 16:19:48 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-04-27 14:44:18 -0400
commitcf3c34c87f921c5c63d47285c9860345cdaf5170 (patch)
tree72d9e78f4b8ece7c3efd87ffdc32dc8466aada83 /drivers/media/video/saa7134/saa7134-dvb.c
parent3b35b4b38049356b1e0b8e64ee27d1aca606b766 (diff)
V4L/DVB (5391): Saa7134: Clean up printk()s
Change some debug messages from printk() to dprintk(). Add KERN_WARNING and KERN_ERR level indicators to other printk()s that lacked them. Format printk lines with consistent ("%s/dvb: ", dev->name) prefix. Fixed dprintk macro, which had an if with no else that wasn't protected with a do {} while(0) block. That leads to "if(...) dprintk(); else" not doing what one would expect. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Acked-by: Hartmut Hackmann <hartmut.hackmann@t-online.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-dvb.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 3887f04cc60a..aa17873aa163 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -60,8 +60,12 @@ static int debug = 0;
60module_param(debug, int, 0644); 60module_param(debug, int, 0644);
61MODULE_PARM_DESC(debug, "Turn on/off module debugging (default:off)."); 61MODULE_PARM_DESC(debug, "Turn on/off module debugging (default:off).");
62 62
63#define dprintk(fmt, arg...) if (debug) \ 63#define dprintk(fmt, arg...) do { if (debug) \
64 printk(KERN_DEBUG "%s/dvb: " fmt, dev->name , ## arg) 64 printk(KERN_DEBUG "%s/dvb: " fmt, dev->name , ## arg); } while(0)
65
66/* Print a warning */
67#define wprintk(fmt, arg...) \
68 printk(KERN_WARNING "%s/dvb: " fmt, dev->name, ## arg)
65 69
66/* ------------------------------------------------------------------ 70/* ------------------------------------------------------------------
67 * mt352 based DVB-T cards 71 * mt352 based DVB-T cards
@@ -87,8 +91,7 @@ static int pinnacle_antenna_pwr(struct saa7134_dev *dev, int on)
87 saa_setl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 28)); 91 saa_setl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 28));
88 udelay(10); 92 udelay(10);
89 ok = saa_readl(SAA7134_GPIO_GPSTATUS0) & (1 << 27); 93 ok = saa_readl(SAA7134_GPIO_GPSTATUS0) & (1 << 27);
90 printk("%s: %s %s\n", dev->name, __FUNCTION__, 94 dprintk("%s %s\n", __FUNCTION__, ok ? "on" : "off");
91 ok ? "on" : "off");
92 95
93 if (!ok) 96 if (!ok)
94 saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 26)); 97 saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 26));
@@ -108,7 +111,7 @@ static int mt352_pinnacle_init(struct dvb_frontend* fe)
108 static u8 irq_cfg [] = { INTERRUPT_EN_0, 0x00, 0x00, 0x00, 0x00 }; 111 static u8 irq_cfg [] = { INTERRUPT_EN_0, 0x00, 0x00, 0x00, 0x00 };
109 struct saa7134_dev *dev= fe->dvb->priv; 112 struct saa7134_dev *dev= fe->dvb->priv;
110 113
111 printk("%s: %s called\n",dev->name,__FUNCTION__); 114 dprintk("%s called\n", __FUNCTION__);
112 115
113 mt352_write(fe, clock_config, sizeof(clock_config)); 116 mt352_write(fe, clock_config, sizeof(clock_config));
114 udelay(200); 117 udelay(200);
@@ -292,7 +295,8 @@ static int philips_tda6651_pll_set(struct dvb_frontend *fe, struct dvb_frontend_
292 if (fe->ops.i2c_gate_ctrl) 295 if (fe->ops.i2c_gate_ctrl)
293 fe->ops.i2c_gate_ctrl(fe, 1); 296 fe->ops.i2c_gate_ctrl(fe, 1);
294 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) { 297 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) {
295 printk("%s/dvb: could not write to tuner at addr: 0x%02x\n",dev->name, addr << 1); 298 wprintk("could not write to tuner at addr: 0x%02x\n",
299 addr << 1);
296 return -EIO; 300 return -EIO;
297 } 301 }
298 msleep(1); 302 msleep(1);
@@ -562,7 +566,8 @@ static int philips_fmd1216_tuner_set_params(struct dvb_frontend *fe, struct dvb_
562 if (fe->ops.i2c_gate_ctrl) 566 if (fe->ops.i2c_gate_ctrl)
563 fe->ops.i2c_gate_ctrl(fe, 1); 567 fe->ops.i2c_gate_ctrl(fe, 1);
564 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) { 568 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) {
565 printk("%s/dvb: could not write to tuner at addr: 0x%02x\n",dev->name, addr << 1); 569 wprintk("could not write to tuner at addr: 0x%02x\n",
570 addr << 1);
566 return -EIO; 571 return -EIO;
567 } 572 }
568 return 0; 573 return 0;
@@ -609,7 +614,8 @@ static void philips_tda827x_lna_gain(struct dvb_frontend *fe, int high)
609 saa7134_set_gpio(dev, 22, 0); 614 saa7134_set_gpio(dev, 22, 0);
610 GP00_LEV[1] = high ? 0 : 1; 615 GP00_LEV[1] = high ? 0 : 1;
611 if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) { 616 if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) {
612 printk("%s/dvb: could not access tda8290 at addr: 0x%02x\n",dev->name, addr << 1); 617 wprintk("could not access tda8290 at addr: 0x%02x\n",
618 addr << 1);
613 return; 619 return;
614 } 620 }
615 msg.buf = GP00_LEV; 621 msg.buf = GP00_LEV;
@@ -637,7 +643,8 @@ static int tda8290_i2c_gate_ctrl( struct dvb_frontend* fe, int enable)
637 tda8290_msg.buf = tda8290_open; 643 tda8290_msg.buf = tda8290_open;
638 } 644 }
639 if (i2c_transfer(state->i2c, &tda8290_msg, 1) != 1) { 645 if (i2c_transfer(state->i2c, &tda8290_msg, 1) != 1) {
640 printk("saa7134/dvb: could not access tda8290 I2C gate\n"); 646 struct saa7134_dev *dev = fe->dvb->priv;
647 wprintk("could not access tda8290 I2C gate\n");
641 return -EIO; 648 return -EIO;
642 } 649 }
643 msleep(20); 650 msleep(20);
@@ -694,7 +701,7 @@ static void configure_tda827x_fe(struct saa7134_dev *dev, struct tda1004x_config
694 dev->dvb.frontend->ops.i2c_gate_ctrl = tda8290_i2c_gate_ctrl; 701 dev->dvb.frontend->ops.i2c_gate_ctrl = tda8290_i2c_gate_ctrl;
695 if (dvb_attach(tda827x_attach, dev->dvb.frontend, tda_conf->tuner_address, 702 if (dvb_attach(tda827x_attach, dev->dvb.frontend, tda_conf->tuner_address,
696 &dev->i2c_adap,&tda827x_cfg) == NULL) { 703 &dev->i2c_adap,&tda827x_cfg) == NULL) {
697 printk ("saa7134/dvb: no tda827x tuner found at addr: %02x\n", 704 wprintk("no tda827x tuner found at addr: %02x\n",
698 tda_conf->tuner_address); 705 tda_conf->tuner_address);
699 } 706 }
700 } 707 }
@@ -942,7 +949,7 @@ static int dvb_init(struct saa7134_dev *dev)
942 949
943 switch (dev->board) { 950 switch (dev->board) {
944 case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL: 951 case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL:
945 printk("%s: pinnacle 300i dvb setup\n",dev->name); 952 dprintk("pinnacle 300i dvb setup\n");
946 dev->dvb.frontend = dvb_attach(mt352_attach, &pinnacle_300i, 953 dev->dvb.frontend = dvb_attach(mt352_attach, &pinnacle_300i,
947 &dev->i2c_adap); 954 &dev->i2c_adap);
948 if (dev->dvb.frontend) { 955 if (dev->dvb.frontend) {
@@ -951,7 +958,7 @@ static int dvb_init(struct saa7134_dev *dev)
951 break; 958 break;
952 case SAA7134_BOARD_AVERMEDIA_777: 959 case SAA7134_BOARD_AVERMEDIA_777:
953 case SAA7134_BOARD_AVERMEDIA_A16AR: 960 case SAA7134_BOARD_AVERMEDIA_A16AR:
954 printk("%s: avertv 777 dvb setup\n",dev->name); 961 dprintk("avertv 777 dvb setup\n");
955 dev->dvb.frontend = dvb_attach(mt352_attach, &avermedia_777, 962 dev->dvb.frontend = dvb_attach(mt352_attach, &avermedia_777,
956 &dev->i2c_adap); 963 &dev->i2c_adap);
957 if (dev->dvb.frontend) { 964 if (dev->dvb.frontend) {
@@ -1026,11 +1033,11 @@ static int dvb_init(struct saa7134_dev *dev)
1026 if (dev->dvb.frontend) { 1033 if (dev->dvb.frontend) {
1027 if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x63, 1034 if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x63,
1028 &dev->i2c_adap, 0) == NULL) { 1035 &dev->i2c_adap, 0) == NULL) {
1029 printk("%s: Lifeview Trio, No tda826x found!\n", __FUNCTION__); 1036 wprintk("%s: Lifeview Trio, No tda826x found!\n", __FUNCTION__);
1030 } 1037 }
1031 if (dvb_attach(isl6421_attach, dev->dvb.frontend, &dev->i2c_adap, 1038 if (dvb_attach(isl6421_attach, dev->dvb.frontend, &dev->i2c_adap,
1032 0x08, 0, 0) == NULL) { 1039 0x08, 0, 0) == NULL) {
1033 printk("%s: Lifeview Trio, No ISL6421 found!\n", __FUNCTION__); 1040 wprintk("%s: Lifeview Trio, No ISL6421 found!\n", __FUNCTION__);
1034 } 1041 }
1035 } 1042 }
1036 } 1043 }
@@ -1044,7 +1051,7 @@ static int dvb_init(struct saa7134_dev *dev)
1044 if (dvb_attach(tda827x_attach,dev->dvb.frontend, 1051 if (dvb_attach(tda827x_attach,dev->dvb.frontend,
1045 ads_tech_duo_config.tuner_address, 1052 ads_tech_duo_config.tuner_address,
1046 &dev->i2c_adap,&ads_duo_cfg) == NULL) { 1053 &dev->i2c_adap,&ads_duo_cfg) == NULL) {
1047 printk ("saa7134/dvb: no tda827x tuner found at addr: %02x\n", 1054 wprintk("no tda827x tuner found at addr: %02x\n",
1048 ads_tech_duo_config.tuner_address); 1055 ads_tech_duo_config.tuner_address);
1049 } 1056 }
1050 } 1057 }
@@ -1077,11 +1084,11 @@ static int dvb_init(struct saa7134_dev *dev)
1077 if (dev->dvb.frontend) { 1084 if (dev->dvb.frontend) {
1078 if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x60, 1085 if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x60,
1079 &dev->i2c_adap, 0) == NULL) { 1086 &dev->i2c_adap, 0) == NULL) {
1080 printk("%s: No tda826x found!\n", __FUNCTION__); 1087 wprintk("%s: No tda826x found!\n", __FUNCTION__);
1081 } 1088 }
1082 if (dvb_attach(isl6421_attach, dev->dvb.frontend, 1089 if (dvb_attach(isl6421_attach, dev->dvb.frontend,
1083 &dev->i2c_adap, 0x08, 0, 0) == NULL) { 1090 &dev->i2c_adap, 0x08, 0, 0) == NULL) {
1084 printk("%s: No ISL6421 found!\n", __FUNCTION__); 1091 wprintk("%s: No ISL6421 found!\n", __FUNCTION__);
1085 } 1092 }
1086 } 1093 }
1087 break; 1094 break;
@@ -1115,12 +1122,12 @@ static int dvb_init(struct saa7134_dev *dev)
1115 configure_tda827x_fe(dev, &philips_tiger_s_config); 1122 configure_tda827x_fe(dev, &philips_tiger_s_config);
1116 break; 1123 break;
1117 default: 1124 default:
1118 printk("%s: Huh? unknown DVB card?\n",dev->name); 1125 wprintk("Huh? unknown DVB card?\n");
1119 break; 1126 break;
1120 } 1127 }
1121 1128
1122 if (NULL == dev->dvb.frontend) { 1129 if (NULL == dev->dvb.frontend) {
1123 printk("%s: frontend initialization failed\n",dev->name); 1130 printk(KERN_ERR "%s/dvb: frontend initialization failed\n", dev->name);
1124 return -1; 1131 return -1;
1125 } 1132 }
1126 1133