linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrien Schildknecht <adrien+dev@schischi.me>
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 <adrien+dev@schischi.me>
Subject: [PATCH] mmc: add ifdef around fault_create_debugfs_attr()
Date: Fri,  6 Nov 2015 13:15:36 +0100	[thread overview]
Message-ID: <1446812136-31526-1-git-send-email-adrien+dev@schischi.me> (raw)

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 <adrien+dev@schischi.me>
---
 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


             reply	other threads:[~2015-11-06 12:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-06 12:15 Adrien Schildknecht [this message]
2015-11-09 13:33 ` [PATCH] mmc: add ifdef around fault_create_debugfs_attr() Ulf Hansson
2015-11-10 15:04   ` Adrien Schildknecht
2015-11-10 17:29     ` Ulf Hansson
2015-11-10 19:12       ` [PATCH v2] mmc: kconfig: replace FAULT_INJECTION with FAULT_INJECTION_DEBUG_FS Adrien Schildknecht
2015-11-19 11:29         ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1446812136-31526-1-git-send-email-adrien+dev@schischi.me \
    --to=adrien+dev@schischi.me \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=shawn.lin@rock-chips.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).