From: per.forlin@linaro.org (Per Forlin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 05/12] mmc: mmc_test: add debugfs file to list all tests
Date: Sat, 18 Jun 2011 22:55:19 +0200 [thread overview]
Message-ID: <1308430526-9412-6-git-send-email-per.forlin@linaro.org> (raw)
In-Reply-To: <1308430526-9412-1-git-send-email-per.forlin@linaro.org>
Add a debugfs file "testlist" to print all available tests
Signed-off-by: Per Forlin <per.forlin@linaro.org>
---
drivers/mmc/card/mmc_test.c | 39 ++++++++++++++++++++++++++++++++++++++-
1 files changed, 38 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c
index 233cdfa..e8508e9 100644
--- a/drivers/mmc/card/mmc_test.c
+++ b/drivers/mmc/card/mmc_test.c
@@ -2445,6 +2445,32 @@ static const struct file_operations mmc_test_fops_test = {
.release = single_release,
};
+static int mtf_testlist_show(struct seq_file *sf, void *data)
+{
+ int i;
+
+ mutex_lock(&mmc_test_lock);
+
+ for (i = 0; i < ARRAY_SIZE(mmc_test_cases); i++)
+ seq_printf(sf, "%d:\t%s\n", i+1, mmc_test_cases[i].name);
+
+ mutex_unlock(&mmc_test_lock);
+
+ return 0;
+}
+
+static int mtf_testlist_open(struct inode *inode, struct file *file)
+{
+ return single_open(file, mtf_testlist_show, inode->i_private);
+}
+
+static const struct file_operations mmc_test_fops_testlist = {
+ .open = mtf_testlist_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
+};
+
static void mmc_test_free_file_test(struct mmc_card *card)
{
struct mmc_test_dbgfs_file *df, *dfs;
@@ -2476,7 +2502,18 @@ static int mmc_test_register_file_test(struct mmc_card *card)
if (IS_ERR_OR_NULL(file)) {
dev_err(&card->dev,
- "Can't create file. Perhaps debugfs is disabled.\n");
+ "Can't create test. Perhaps debugfs is disabled.\n");
+ ret = -ENODEV;
+ goto err;
+ }
+
+ if (card->debugfs_root)
+ file = debugfs_create_file("testlist", S_IRUGO,
+ card->debugfs_root, card, &mmc_test_fops_testlist);
+
+ if (IS_ERR_OR_NULL(file)) {
+ dev_err(&card->dev,
+ "Can't create testlist. Perhaps debugfs is disabled.\n");
ret = -ENODEV;
goto err;
}
--
1.7.4.1
next prev parent reply other threads:[~2011-06-18 20:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-18 20:55 [PATCH v5 00/12] mmc: use nonblock mmc requests to minimize latency Per Forlin
2011-06-18 20:55 ` [PATCH v5 01/12] mmc: add none blocking mmc request function Per Forlin
2011-06-18 20:55 ` [PATCH v5 02/12] omap_hsmmc: use original sg_len for dma_unmap_sg Per Forlin
2011-06-18 20:55 ` [PATCH v5 03/12] omap_hsmmc: add support for pre_req and post_req Per Forlin
2011-06-18 20:55 ` [PATCH v5 04/12] mmci: implement pre_req() and post_req() Per Forlin
2011-06-18 20:55 ` Per Forlin [this message]
2011-06-18 20:55 ` [PATCH v5 06/12] mmc: mmc_test: add test for none blocking transfers Per Forlin
2011-06-18 20:55 ` [PATCH v5 07/12] mmc: add member in mmc queue struct to hold request data Per Forlin
2011-06-18 20:55 ` [PATCH v5 08/12] mmc: add a block request prepare function Per Forlin
2011-06-18 20:55 ` [PATCH v5 09/12] mmc: move error code in mmc_block_issue_rw_rq to a separate function Per Forlin
2011-06-18 20:55 ` [PATCH v5 10/12] mmc: add a second mmc queue request member Per Forlin
2011-06-18 20:55 ` [PATCH v5 11/12] mmc: test: add random fault injection in core.c Per Forlin
2011-06-18 20:55 ` [PATCH v5 12/12] mmc: add handling for two parallel block requests in issue_rw_rq Per Forlin
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=1308430526-9412-6-git-send-email-per.forlin@linaro.org \
--to=per.forlin@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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).