]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mtd: mtdblock: Use DEFINE_MUTEX() for mtdblks_lock
authorAxel Lin <axel.lin@gmail.com>
Fri, 3 Jun 2011 06:10:22 +0000 (14:10 +0800)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Sun, 11 Sep 2011 12:01:59 +0000 (15:01 +0300)
mtdblks_lock can be initialized automatically with
DEFINE_MUTEX() rather than explicitly calling mutex_init().

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
drivers/mtd/mtdblock.c

index 3326615ad66b957c57234bf3eb83699a393ff62e..1976b6c0508d68b94f74e6fdd47cda75cb624860 100644 (file)
@@ -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);
 }