aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/core/debugfs.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
index 96c603b0526..da69aac4cc8 100644
--- a/drivers/mmc/core/debugfs.c
+++ b/drivers/mmc/core/debugfs.c
@@ -20,6 +20,14 @@
20#include "core.h" 20#include "core.h"
21#include "mmc_ops.h" 21#include "mmc_ops.h"
22 22
23#ifdef CONFIG_FAIL_MMC_REQUEST
24
25static DECLARE_FAULT_ATTR(fail_default_attr);
26static char *fail_request;
27module_param(fail_request, charp, 0);
28
29#endif /* CONFIG_FAIL_MMC_REQUEST */
30
23/* The debugfs functions are optimized away when CONFIG_DEBUG_FS isn't set. */ 31/* The debugfs functions are optimized away when CONFIG_DEBUG_FS isn't set. */
24static int mmc_ios_show(struct seq_file *s, void *data) 32static int mmc_ios_show(struct seq_file *s, void *data)
25{ 33{
@@ -168,23 +176,6 @@ static int mmc_clock_opt_set(void *data, u64 val)
168 return 0; 176 return 0;
169} 177}
170 178
171#ifdef CONFIG_FAIL_MMC_REQUEST
172
173static DECLARE_FAULT_ATTR(fail_mmc_request);
174
175#ifdef KERNEL
176/*
177 * Internal function. Pass the boot param fail_mmc_request to
178 * the setup fault injection attributes routine.
179 */
180static int __init setup_fail_mmc_request(char *str)
181{
182 return setup_fault_attr(&fail_mmc_request, str);
183}
184__setup("fail_mmc_request=", setup_fail_mmc_request);
185#endif /* KERNEL */
186#endif /* CONFIG_FAIL_MMC_REQUEST */
187
188DEFINE_SIMPLE_ATTRIBUTE(mmc_clock_fops, mmc_clock_opt_get, mmc_clock_opt_set, 179DEFINE_SIMPLE_ATTRIBUTE(mmc_clock_fops, mmc_clock_opt_get, mmc_clock_opt_set,
189 "%llu\n"); 180 "%llu\n");
190 181
@@ -216,7 +207,9 @@ void mmc_add_host_debugfs(struct mmc_host *host)
216 goto err_node; 207 goto err_node;
217#endif 208#endif
218#ifdef CONFIG_FAIL_MMC_REQUEST 209#ifdef CONFIG_FAIL_MMC_REQUEST
219 host->fail_mmc_request = fail_mmc_request; 210 if (fail_request)
211 setup_fault_attr(&fail_default_attr, fail_request);
212 host->fail_mmc_request = fail_default_attr;
220 if (IS_ERR(fault_create_debugfs_attr("fail_mmc_request", 213 if (IS_ERR(fault_create_debugfs_attr("fail_mmc_request",
221 root, 214 root,
222 &host->fail_mmc_request))) 215 &host->fail_mmc_request)))