mtd: mtdblock: Use DEFINE_MUTEX() for mtdblks_lock

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Nov 7 11:59:05 EST 2011


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=7578ca927b1a2a0445c9a3166d05462b9ffd4c06
Commit:     7578ca927b1a2a0445c9a3166d05462b9ffd4c06
Parent:     82e023ab4e144da7f83fe7e6c93a09be2f30ff07
Author:     Axel Lin <axel.lin at gmail.com>
AuthorDate: Fri Jun 3 14:10:22 2011 +0800
Committer:  Artem Bityutskiy <artem.bityutskiy at intel.com>
CommitDate: Sun Sep 11 15:01:59 2011 +0300

    mtd: mtdblock: Use DEFINE_MUTEX() for mtdblks_lock
    
    mtdblks_lock can be initialized automatically with
    DEFINE_MUTEX() rather than explicitly calling mutex_init().
    
    Signed-off-by: Axel Lin <axel.lin at gmail.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
---
 drivers/mtd/mtdblock.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c
index 3326615..1976b6c 100644
--- a/drivers/mtd/mtdblock.c
+++ b/drivers/mtd/mtdblock.c
@@ -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);
 }
 



More information about the linux-mtd-cvs mailing list