From patchwork Sat May 22 11:58:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 175 Return-Path: Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by open-mesh.net (Postfix) with SMTP id 51782154365 for ; Sat, 22 May 2010 08:34:38 +0200 (CEST) Received: (qmail invoked by alias); 22 May 2010 11:58:24 -0000 Received: from unknown (EHLO sven-desktop.lazhur.ath.cx) [89.246.221.101] by mail.gmx.net (mp041) with SMTP; 22 May 2010 13:58:24 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX1+gfo8FP0Sgbg1IftCPqlc4DcOcpFG2i9U8ko489g XFk3J2b7bYJUDN From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Sat, 22 May 2010 13:58:20 +0200 Message-Id: <1274529500-16341-1-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.7.1 X-Y-GMX-Trusted: 0 Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: Only fail in debugfs when kernel has debugfs support X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2010 06:34:38 -0000 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 --- batman-adv-kernelland/bat_debugfs.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) 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)