mmc_test: only bind to supported cards

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, July 16, 2008 - 4:19 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0121a9...
Commit:     0121a9829bf28c65e1a05cc881899c10d82b8de2
Parent:     eea0f581c4e596e02250df230f8d385827977964
Author:     Pierre Ossman <drzeus@drzeus.cx>
AuthorDate: Sat Jun 28 17:51:27 2008 +0200
Committer:  Pierre Ossman <drzeus@drzeus.cx>
CommitDate: Tue Jul 15 14:14:44 2008 +0200

    mmc_test: only bind to supported cards
    
    We can only perform the tests on MMC and SD cards, so avoid binding
    to any other type.
    
    Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
---
 drivers/mmc/card/mmc_test.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c
index 371d922..8e0bb12 100644
--- a/drivers/mmc/card/mmc_test.c
+++ b/drivers/mmc/card/mmc_test.c
@@ -1,7 +1,7 @@
 /*
  *  linux/drivers/mmc/card/mmc_test.c
  *
- *  Copyright 2007 Pierre Ossman
+ *  Copyright 2007-2008 Pierre Ossman
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -858,6 +858,9 @@ static int mmc_test_probe(struct mmc_card *card)
 {
 	int ret;
 
+	if ((card->type != MMC_TYPE_MMC) && (card->type != MMC_TYPE_SD))
+		return -ENODEV;
+
 	mutex_init(&mmc_test_lock);
 
 	ret = device_create_file(&card->dev, &dev_attr_test);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
mmc_test: only bind to supported cards, Linux Kernel Mailing ..., (Wed Jul 16, 4:19 pm)