Skip to contentSkip to conversation

mtd: mtdblock: Use DEFINE_MUTEX() for mtdblks_lock

PATCH Applied Axel Lin 2 participants 2 messages Jun 3, 2011 – Jun 6, 2011 Memory technology devices (MTD)

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 mtd: mtdblock: Use DEFINE_MUTEX() for mtdblks_lock

mtdblks_lock can be initialized automatically with DEFINE_MUTEX() rather than explicitly calling mutex_init().

---
 drivers/mtd/mtdblock.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/mtd/mtdblock.c +1 -3
index 3326615..1976b6c 100644
@@ -44,7 +44,7 @@ struct mtdblk_dev {
 	enum { STATE_EMPTY, STATE_CLEAN, STATE_DIRTY } cache_state;
 };
 
-static struct mutex mtdblks_lock;
+static DEFINE_MUTEX(mtdblks_lock);
 
 /*
  * Cache stuff...
@@ -389,8 +389,6 @@ static struct mtd_blktrans_ops mtdblock_tr = {
 
 static int __init init_mtdblock(void)
 {
-	mutex_init(&mtdblks_lock);
-
 	return register_mtd_blktrans(&mtdblock_tr);
 }
 
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 4 lines · Axel Lin

mtdblks_lock can be initialized automatically with DEFINE_MUTEX() rather than explicitly calling mutex_init().

Pushed to l2-mtd-2.6.git, thanks!

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)