mirror of https://gitee.com/openkylin/linux.git
staging: easycap: group module parameters handling
1. For readability group module parameters handling on one place 2. Introduce kernel config option EASY_DEBUG Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
3dbab73312
commit
02149cf7c7
|
@ -15,3 +15,15 @@ config EASYCAP
|
|||
To compile this driver as a module, choose M here: the
|
||||
module will be called easycap
|
||||
|
||||
config EASYCAP_DEBUG
|
||||
bool "Enable EasyCAP driver debugging"
|
||||
depends on EASYCAP
|
||||
|
||||
---help---
|
||||
This option enables debug printouts
|
||||
|
||||
To enable debug, pass the debug level to the debug module
|
||||
parameter:
|
||||
|
||||
modprobe easycap debug=[0..9]
|
||||
|
||||
|
|
|
@ -668,7 +668,6 @@ unsigned long long int remainder;
|
|||
* IMMEDIATELY OBVIOUS FROM A CASUAL READING OF THE SOURCE CODE. BEWARE.
|
||||
*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
extern int easycap_debug;
|
||||
#define SAY(format, args...) do { \
|
||||
printk(KERN_DEBUG "easycap:: %s: " \
|
||||
format, __func__, ##args); \
|
||||
|
@ -678,7 +677,8 @@ extern int easycap_debug;
|
|||
format, peasycap->isdongle, __func__, ##args);\
|
||||
} while (0)
|
||||
|
||||
#if defined(EASYCAP_DEBUG)
|
||||
#ifdef CONFIG_EASYCAP_DEBUG
|
||||
extern int easycap_debug;
|
||||
#define JOT(n, format, args...) do { \
|
||||
if (n <= easycap_debug) { \
|
||||
printk(KERN_DEBUG "easycap:: %s: " \
|
||||
|
@ -695,7 +695,7 @@ extern int easycap_debug;
|
|||
#else
|
||||
#define JOT(n, format, args...) do {} while (0)
|
||||
#define JOM(n, format, args...) do {} while (0)
|
||||
#endif /*EASYCAP_DEBUG*/
|
||||
#endif /* CONFIG_EASYCAP_DEBUG */
|
||||
|
||||
#define MICROSECONDS(X, Y) \
|
||||
((1000000*((long long int)(X.tv_sec - Y.tv_sec))) + \
|
||||
|
|
|
@ -30,13 +30,26 @@
|
|||
|
||||
#include "easycap.h"
|
||||
|
||||
int easycap_debug;
|
||||
static int easycap_bars = 1;
|
||||
static int easycap_gain = 16;
|
||||
module_param_named(debug, easycap_debug, int, S_IRUGO | S_IWUSR);
|
||||
module_param_named(bars, easycap_bars, int, S_IRUGO | S_IWUSR);
|
||||
module_param_named(gain, easycap_gain, int, S_IRUGO | S_IWUSR);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("R.M. Thomas <rmthomas@sciolus.org>");
|
||||
MODULE_DESCRIPTION(EASYCAP_DRIVER_DESCRIPTION);
|
||||
MODULE_VERSION(EASYCAP_DRIVER_VERSION);
|
||||
|
||||
#ifdef CONFIG_EASYCAP_DEBUG
|
||||
int easycap_debug;
|
||||
module_param_named(debug, easycap_debug, int, S_IRUGO | S_IWUSR);
|
||||
MODULE_PARM_DESC(debug, "Debug level: 0(default),1,2,...,9");
|
||||
#endif /* CONFIG_EASYCAP_DEBUG */
|
||||
|
||||
static int easycap_bars = 1;
|
||||
module_param_named(bars, easycap_bars, int, S_IRUGO | S_IWUSR);
|
||||
MODULE_PARM_DESC(bars,
|
||||
"Testcard bars on input signal failure: 0=>no, 1=>yes(default)");
|
||||
|
||||
static int easycap_gain = 16;
|
||||
module_param_named(gain, easycap_gain, int, S_IRUGO | S_IWUSR);
|
||||
MODULE_PARM_DESC(gain, "Audio gain: 0,...,16(default),...31");
|
||||
struct easycap_dongle easycapdc60_dongle[DONGLE_MANY];
|
||||
static struct mutex mutex_dongle;
|
||||
|
||||
|
@ -5113,14 +5126,4 @@ JOT(4, "ends\n");
|
|||
module_init(easycap_module_init);
|
||||
module_exit(easycap_module_exit);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("R.M. Thomas <rmthomas@sciolus.org>");
|
||||
MODULE_DESCRIPTION(EASYCAP_DRIVER_DESCRIPTION);
|
||||
MODULE_VERSION(EASYCAP_DRIVER_VERSION);
|
||||
#if defined(EASYCAP_DEBUG)
|
||||
MODULE_PARM_DESC(debug, "Debug level: 0(default),1,2,...,9");
|
||||
#endif /*EASYCAP_DEBUG*/
|
||||
MODULE_PARM_DESC(bars,
|
||||
"Testcard bars on input signal failure: 0=>no, 1=>yes(default)");
|
||||
MODULE_PARM_DESC(gain, "Audio gain: 0,...,16(default),...31");
|
||||
/*****************************************************************************/
|
||||
|
|
Loading…
Reference in New Issue