diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2008-09-13 19:03:32 +0900 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2008-09-20 13:03:50 +0200 |
commit | a650031a6bd16cb6789da9b3c27fc97341239f12 (patch) | |
tree | c16f1426a9d911dc2dfa327fa932a01ef2179171 /drivers/mmc | |
parent | 9d4e98e9609bc19d4a8ac4a5c3218358d1820114 (diff) |
mmc_test: initialize mmc_test_lock statically
The mutex mmc_test_lock is initialized at every time mmc_test device
is probed. Probing another mmc_test device may break the mutex, if
the probe function is called while the mutex is locked.
This patch fixes it by statically initializing mmc_test_lock.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/card/mmc_test.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c index f26b01d811a..b92b172074e 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; |