From: Jim C. <jim...@gm...> - 2012-05-19 07:38:27
|
Drop redundant fn-protos, rely only on those at top of merge.h Modify #ifdef ACX_WANT_PROC_FILES_ANYWAY, add CONFIG_PROC_FS, Modify #ifdef CONFIG_DEBUG_FS, add !ACX_NO_DEBUG_FS, to allow suppression of debug files, mostly to broaden range of possible configs, and to allow testing them. Signed-off-by: Jim Cromie <jim...@gm...> --- common.c | 7 +------ debugfs.c | 15 +++++---------- merge.h | 4 +--- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/common.c b/common.c index ce51d8d..9b957f7 100644 --- a/common.c +++ b/common.c @@ -4941,7 +4941,7 @@ out: return ret; } -#ifdef ACX_WANT_PROC_FILES_ANYWAY +#if defined CONFIG_PROC_FS && defined ACX_WANT_PROC_FILES_ANYWAY static int acx_proc_open(struct inode *inode, struct file *file) { @@ -6235,8 +6235,6 @@ end: * BOM Mac80211 Ops * ================================================== */ -int acx_debugfs_add_adev(struct acx_device *adev); -void acx_debugfs_remove_adev(struct acx_device *adev); int acx_op_add_interface(struct ieee80211_hw *ieee, struct ieee80211_VIF *vif) { @@ -6853,8 +6851,6 @@ void great_inquisitor(acx_device_t * adev) * BOM Driver, Module * ================================================== */ -int __init acx_debugfs_init(void); -void __init acx_debugfs_exit(void); static int __init acx_init_module(void) { @@ -6893,7 +6889,6 @@ static int __init acx_init_module(void) return 0; } -void acx_debugfs_exit(void); static void __exit acx_cleanup_module(void) { /* TODO Check, that interface isn't still up */ diff --git a/debugfs.c b/debugfs.c index e47757b..c3012ce 100644 --- a/debugfs.c +++ b/debugfs.c @@ -1,13 +1,8 @@ - -#ifndef CONFIG_DEBUG_FS - -/* API: not static inline - must be available for linking */ -int __init acx_debugfs_init(void) { return 0; } -void __exit acx_debugfs_exit(void) {} -int acx_debugfs_add_adev (struct acx_device *adev) { return 0; } -void acx_debugfs_remove_adev(struct acx_device *adev) { return 0; } - -#else /* CONFIG_DEBUG_FS */ +/* + * debugfs API to rest of driver is prototyped in merge.h, including + * the stubs. + */ +#if defined CONFIG_DEBUG_FS && !defined ACX_NO_DEBUG_FS #define pr_fmt(fmt) "acx.%s: " fmt, __func__ diff --git a/merge.h b/merge.h index 337aa46..4f30bad 100644 --- a/merge.h +++ b/merge.h @@ -15,16 +15,14 @@ extern acx_proc_show_t *const acx_proc_show_funcs[]; extern acx_proc_write_t *const acx_proc_write_funcs[]; /* debugfs.c API used by common.c */ -#if defined CONFIG_DEBUG_FS +#if defined CONFIG_DEBUG_FS && !defined ACX_NO_DEBUG_FS int acx_debugfs_add_adev(struct acx_device *adev); void acx_debugfs_remove_adev(struct acx_device *adev); -int acx_proc_register_entries(struct ieee80211_hw *hw); int __init acx_debugfs_init(void); void __exit acx_debugfs_exit(void); #else static int acx_debugfs_add_adev(struct acx_device *adev) { return 0; } static void acx_debugfs_remove_adev(struct acx_device *adev) { } -static int acx_proc_register_entries(struct ieee80211_hw *hw) { return 0; } static int __init acx_debugfs_init(void) { return 0; } static void __exit acx_debugfs_exit(void) { } #endif /* defined CONFIG_DEBUG_FS */ -- 1.7.10.1.487.ga3935e6 |