Skip to content

Commit b33d24c

Browse files
AdrianBunkmchehab
authored andcommitted
V4L/DVB (7750): au0828/ cleanups and fixes
This patch contains the following cleanups and fixes: - "debug" is definitely not a good name for a global variable, renamed it to "au0828_debug" this fixes a compile error with some kernel configurations - since the module parameter is int the variable shouldn't be unsigned - remove the {usb,bridge,i2c}_debug module parameters since they are already covered by the "debug" module parameter - remove the unused au0828_bcount - make the needlessly global i2c_scan static - make the needlessly global dvb_register() static Signed-off-by: Adrian Bunk <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent b9ef6bb commit b33d24c

File tree

5 files changed

+10
-33
lines changed

5 files changed

+10
-33
lines changed

drivers/media/video/au0828/au0828-cards.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ struct au0828_board au0828_boards[] = {
3636
.name = "DViCO FusionHDTV USB",
3737
},
3838
};
39-
const unsigned int au0828_bcount = ARRAY_SIZE(au0828_boards);
4039

4140
/* Tuner callback function for au0828 boards. Currently only needed
4241
* for HVR1500Q, which has an xc5000 tuner.

drivers/media/video/au0828/au0828-core.c

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,10 @@
3232
* 4 = I2C related
3333
* 8 = Bridge related
3434
*/
35-
unsigned int debug;
36-
module_param(debug, int, 0644);
35+
int au0828_debug;
36+
module_param_named(debug, au0828_debug, int, 0644);
3737
MODULE_PARM_DESC(debug, "enable debug messages");
3838

39-
unsigned int usb_debug;
40-
module_param(usb_debug, int, 0644);
41-
MODULE_PARM_DESC(usb_debug, "enable usb debug messages");
42-
43-
unsigned int bridge_debug;
44-
module_param(bridge_debug, int, 0644);
45-
MODULE_PARM_DESC(bridge_debug, "enable bridge debug messages");
46-
4739
#define _AU0828_BULKPIPE 0x03
4840
#define _BULKPIPESIZE 0xffff
4941

@@ -229,24 +221,18 @@ static int __init au0828_init(void)
229221
{
230222
int ret;
231223

232-
if (debug)
224+
if (au0828_debug & 1)
233225
printk(KERN_INFO "%s() Debugging is enabled\n", __func__);
234226

235-
if (usb_debug) {
227+
if (au0828_debug & 2)
236228
printk(KERN_INFO "%s() USB Debugging is enabled\n", __func__);
237-
debug |= 2;
238-
}
239229

240-
if (i2c_debug) {
230+
if (au0828_debug & 4)
241231
printk(KERN_INFO "%s() I2C Debugging is enabled\n", __func__);
242-
debug |= 4;
243-
}
244232

245-
if (bridge_debug) {
233+
if (au0828_debug & 8)
246234
printk(KERN_INFO "%s() Bridge Debugging is enabled\n",
247235
__func__);
248-
debug |= 8;
249-
}
250236

251237
printk(KERN_INFO "au0828 driver loaded\n");
252238

drivers/media/video/au0828/au0828-dvb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ static int au0828_dvb_stop_feed(struct dvb_demux_feed *feed)
204204
return ret;
205205
}
206206

207-
int dvb_register(struct au0828_dev *dev)
207+
static int dvb_register(struct au0828_dev *dev)
208208
{
209209
struct au0828_dvb *dvb = &dev->dvb;
210210
int result;

drivers/media/video/au0828/au0828-i2c.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@
2929

3030
#include <media/v4l2-common.h>
3131

32-
unsigned int i2c_debug;
33-
module_param(i2c_debug, int, 0444);
34-
MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]");
35-
36-
unsigned int i2c_scan;
32+
static int i2c_scan;
3733
module_param(i2c_scan, int, 0444);
3834
MODULE_PARM_DESC(i2c_scan, "scan i2c bus at insmod time");
3935

drivers/media/video/au0828/au0828.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,12 @@ struct au0828_buff {
9696
/* au0828-core.c */
9797
extern u32 au0828_read(struct au0828_dev *dev, u16 reg);
9898
extern u32 au0828_write(struct au0828_dev *dev, u16 reg, u32 val);
99-
extern unsigned int debug;
100-
extern unsigned int usb_debug;
101-
extern unsigned int bridge_debug;
99+
extern int au0828_debug;
102100

103101
/* ----------------------------------------------------------- */
104102
/* au0828-cards.c */
105103
extern struct au0828_board au0828_boards[];
106104
extern struct usb_device_id au0828_usb_id_table[];
107-
extern const unsigned int au0828_bcount;
108105
extern void au0828_gpio_setup(struct au0828_dev *dev);
109106
extern int au0828_tuner_callback(void *priv, int command, int arg);
110107
extern void au0828_card_setup(struct au0828_dev *dev);
@@ -115,14 +112,13 @@ extern int au0828_i2c_register(struct au0828_dev *dev);
115112
extern int au0828_i2c_unregister(struct au0828_dev *dev);
116113
extern void au0828_call_i2c_clients(struct au0828_dev *dev,
117114
unsigned int cmd, void *arg);
118-
extern unsigned int i2c_debug;
119115

120116
/* ----------------------------------------------------------- */
121117
/* au0828-dvb.c */
122118
extern int au0828_dvb_register(struct au0828_dev *dev);
123119
extern void au0828_dvb_unregister(struct au0828_dev *dev);
124120

125121
#define dprintk(level, fmt, arg...)\
126-
do { if (debug & level)\
122+
do { if (au0828_debug & level)\
127123
printk(KERN_DEBUG DRIVER_NAME "/0: " fmt, ## arg);\
128124
} while (0)

0 commit comments

Comments
 (0)