summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-09-21 12:38:45 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-09-21 12:38:45 -0700
commit5c0a95c73f80c034914e219eee8075acdf56b527 (patch)
treeb6c4eba6b5a1070a673159f14472de741535eb79 /drivers/mmc/card
parentbaaea1dc0befb7b64e6dbf2d1469d0a296a79e54 (diff)
parenta650031a6bd16cb6789da9b3c27fc97341239f12 (diff)
downloadop-kernel-dev-5c0a95c73f80c034914e219eee8075acdf56b527.zip
op-kernel-dev-5c0a95c73f80c034914e219eee8075acdf56b527.tar.gz
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc: mmc_test: initialize mmc_test_lock statically mmc_block: handle error from mmc_register_driver() atmel-mci: Set MMC_CAP_NEEDS_POLL if no detect_pin atmel-mci: Fix bogus debugfs file size atmel-mci: Fix memory leak in atmci_regs_show atmel-mci: debugfs: enable clock before dumping regs tmio_mmc: fix compilation with debug enabled
Diffstat (limited to 'drivers/mmc/card')
-rw-r--r--drivers/mmc/card/block.c9
-rw-r--r--drivers/mmc/card/mmc_test.c4
2 files changed, 8 insertions, 5 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 6986f39..ebc8b9d 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -615,14 +615,19 @@ static struct mmc_driver mmc_driver = {
static int __init mmc_blk_init(void)
{
- int res = -ENOMEM;
+ int res;
res = register_blkdev(MMC_BLOCK_MAJOR, "mmc");
if (res)
goto out;
- return mmc_register_driver(&mmc_driver);
+ res = mmc_register_driver(&mmc_driver);
+ if (res)
+ goto out2;
+ return 0;
+ out2:
+ unregister_blkdev(MMC_BLOCK_MAJOR, "mmc");
out:
return res;
}
diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c
index f26b01d..b92b172 100644
--- a/drivers/mmc/card/mmc_test.c
+++ b/drivers/mmc/card/mmc_test.c
@@ -1040,7 +1040,7 @@ static const struct mmc_test_case mmc_test_cases[] = {
};
-static struct mutex mmc_test_lock;
+static DEFINE_MUTEX(mmc_test_lock);
static void mmc_test_run(struct mmc_test_card *test, int testcase)
{
@@ -1171,8 +1171,6 @@ static int mmc_test_probe(struct mmc_card *card)
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);
if (ret)
return ret;
OpenPOWER on IntegriCloud