diff mbox

batman-adv: Only fail in debugfs when kernel has debugfs support

Message ID 1274529500-16341-1-git-send-email-sven.eckelmann@gmx.de
State Accepted, archived
Headers show

Commit Message

Sven Eckelmann May 22, 2010, 11:58 a.m. UTC
Linux allows to call debugfs related functions even when it is not
compiled in. The return codes will always be failure return codes and we
would fail to load the batman-adv module even when debugfs isn't a hard
dependency.

We can simply return a success error code when the debugfs stub returned
a error code and the kernel was compiled without debugfs support.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
 batman-adv-kernelland/bat_debugfs.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Comments

Marek Lindner May 22, 2010, 12:56 p.m. UTC | #1
On Saturday 22 May 2010 19:58:20 Sven Eckelmann wrote:
> Linux allows to call debugfs related functions even when it is not
> compiled in. The return codes will always be failure return codes and we
> would fail to load the batman-adv module even when debugfs isn't a hard
> dependency.
> 
> We can simply return a success error code when the debugfs stub returned
> a error code and the kernel was compiled without debugfs support.

Applied in rev 1679. 

Thanks,
Marek
diff mbox

Patch

diff --git a/batman-adv-kernelland/bat_debugfs.c b/batman-adv-kernelland/bat_debugfs.c
index 9113601..bc1591f 100644
--- a/batman-adv-kernelland/bat_debugfs.c
+++ b/batman-adv-kernelland/bat_debugfs.c
@@ -141,7 +141,11 @@  rem_attr:
 	debugfs_remove_recursive(bat_priv->debug_dir);
 	bat_priv->debug_dir = NULL;
 out:
+#ifdef CONFIG_DEBUG_FS
 	return -ENOMEM;
+#else
+	return 0;
+#endif /* CONFIG_DEBUG_FS */
 }
 
 void debugfs_del_meshif(struct net_device *dev)