aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card
diff options
context:
space:
mode:
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 6986f3926244..ebc8b9d77613 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -615,14 +615,19 @@ static struct mmc_driver mmc_driver = {
615 615
616static int __init mmc_blk_init(void) 616static int __init mmc_blk_init(void)
617{ 617{
618 int res = -ENOMEM; 618 int res;
619 619
620 res = register_blkdev(MMC_BLOCK_MAJOR, "mmc"); 620 res = register_blkdev(MMC_BLOCK_MAJOR, "mmc");
621 if (res) 621 if (res)
622 goto out; 622 goto out;
623 623
624 return mmc_register_driver(&mmc_driver); 624 res = mmc_register_driver(&mmc_driver);
625 if (res)
626 goto out2;
625 627
628 return 0;
629 out2:
630 unregister_blkdev(MMC_BLOCK_MAJOR, "mmc");
626 out: 631 out:
627 return res; 632 return res;
628} 633}
diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c
index f26b01d811ae..b92b172074ee 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[] = {
1040 1040
1041}; 1041};
1042 1042
1043static struct mutex mmc_test_lock; 1043static DEFINE_MUTEX(mmc_test_lock);
1044 1044
1045static void mmc_test_run(struct mmc_test_card *test, int testcase) 1045static void mmc_test_run(struct mmc_test_card *test, int testcase)
1046{ 1046{
@@ -1171,8 +1171,6 @@ static int mmc_test_probe(struct mmc_card *card)
1171 if ((card->type != MMC_TYPE_MMC) && (card->type != MMC_TYPE_SD)) 1171 if ((card->type != MMC_TYPE_MMC) && (card->type != MMC_TYPE_SD))
1172 return -ENODEV; 1172 return -ENODEV;
1173 1173
1174 mutex_init(&mmc_test_lock);
1175
1176 ret = device_create_file(&card->dev, &dev_attr_test); 1174 ret = device_create_file(&card->dev, &dev_attr_test);
1177 if (ret) 1175 if (ret)
1178 return ret; 1176 return ret;