Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161383AbbKFMQS (ORCPT ); Fri, 6 Nov 2015 07:16:18 -0500 Received: from mail-wi0-f172.google.com ([209.85.212.172]:37667 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161212AbbKFMQR (ORCPT ); Fri, 6 Nov 2015 07:16:17 -0500 From: Adrien Schildknecht To: ulf.hansson@linaro.org, shawn.lin@rock-chips.com, linus.walleij@linaro.org Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Adrien Schildknecht Subject: [PATCH] mmc: add ifdef around fault_create_debugfs_attr() Date: Fri, 6 Nov 2015 13:15:36 +0100 Message-Id: <1446812136-31526-1-git-send-email-adrien+dev@schischi.me> X-Mailer: git-send-email 2.6.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1263 Lines: 38 FAIL_MMC_REQUEST can be used without FAULT_INJECTION_DEBUG_FS. In this case fault_create_debugfs_attr() will always return an error and lead to the deletion of the whole debugfs directory. This patch makes sure that FAULT_INJECTION_DEBUG_FS is enabled before attempting to create the debugfs atttribute. Signed-off-by: Adrien Schildknecht --- drivers/mmc/core/debugfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c index 154aced..13e842c 100644 --- a/drivers/mmc/core/debugfs.c +++ b/drivers/mmc/core/debugfs.c @@ -259,11 +259,13 @@ void mmc_add_host_debugfs(struct mmc_host *host) if (fail_request) setup_fault_attr(&fail_default_attr, fail_request); host->fail_mmc_request = fail_default_attr; +#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS if (IS_ERR(fault_create_debugfs_attr("fail_mmc_request", root, &host->fail_mmc_request))) goto err_node; #endif +#endif return; err_node: -- 2.6.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/