Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255215
b: refs/heads/master
c: 54f3caf
h: refs/heads/master
i:
  255213: 0c89e96
  255211: 23b1978
  255207: c04f576
  255199: 120f3ed
v: v3
  • Loading branch information
Per Forlin authored and Chris Ball committed Jul 20, 2011
1 parent d5bf1b6 commit 9f25f10
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 58c7ccbf9109abcc6b7ed2f76c21ebee244d31a8
refs/heads/master: 54f3caf5bcb732c9ac48308b7b43eb9aaa7ed8ca
39 changes: 38 additions & 1 deletion trunk/drivers/mmc/card/mmc_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 9f25f10

Please sign in to comment.