diff options
Diffstat (limited to 'drivers/mtd/devices/blkmtd.c')
-rw-r--r-- | drivers/mtd/devices/blkmtd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mtd/devices/blkmtd.c b/drivers/mtd/devices/blkmtd.c index 04f864d238db..d732532635a1 100644 --- a/drivers/mtd/devices/blkmtd.c +++ b/drivers/mtd/devices/blkmtd.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <linux/list.h> | 29 | #include <linux/list.h> |
30 | #include <linux/init.h> | 30 | #include <linux/init.h> |
31 | #include <linux/mtd/mtd.h> | 31 | #include <linux/mtd/mtd.h> |
32 | 32 | #include <linux/mutex.h> | |
33 | 33 | ||
34 | #define err(format, arg...) printk(KERN_ERR "blkmtd: " format "\n" , ## arg) | 34 | #define err(format, arg...) printk(KERN_ERR "blkmtd: " format "\n" , ## arg) |
35 | #define info(format, arg...) printk(KERN_INFO "blkmtd: " format "\n" , ## arg) | 35 | #define info(format, arg...) printk(KERN_INFO "blkmtd: " format "\n" , ## arg) |
@@ -46,7 +46,7 @@ struct blkmtd_dev { | |||
46 | struct list_head list; | 46 | struct list_head list; |
47 | struct block_device *blkdev; | 47 | struct block_device *blkdev; |
48 | struct mtd_info mtd_info; | 48 | struct mtd_info mtd_info; |
49 | struct semaphore wrbuf_mutex; | 49 | struct mutex wrbuf_mutex; |
50 | }; | 50 | }; |
51 | 51 | ||
52 | 52 | ||
@@ -268,7 +268,7 @@ static int write_pages(struct blkmtd_dev *dev, const u_char *buf, loff_t to, | |||
268 | if(end_len) | 268 | if(end_len) |
269 | pagecnt++; | 269 | pagecnt++; |
270 | 270 | ||
271 | down(&dev->wrbuf_mutex); | 271 | mutex_lock(&dev->wrbuf_mutex); |
272 | 272 | ||
273 | DEBUG(3, "blkmtd: write: start_len = %zd len = %zd end_len = %zd pagecnt = %d\n", | 273 | DEBUG(3, "blkmtd: write: start_len = %zd len = %zd end_len = %zd pagecnt = %d\n", |
274 | start_len, len, end_len, pagecnt); | 274 | start_len, len, end_len, pagecnt); |
@@ -376,7 +376,7 @@ static int write_pages(struct blkmtd_dev *dev, const u_char *buf, loff_t to, | |||
376 | blkmtd_write_out(bio); | 376 | blkmtd_write_out(bio); |
377 | 377 | ||
378 | DEBUG(2, "blkmtd: write: end, retlen = %zd, err = %d\n", *retlen, err); | 378 | DEBUG(2, "blkmtd: write: end, retlen = %zd, err = %d\n", *retlen, err); |
379 | up(&dev->wrbuf_mutex); | 379 | mutex_unlock(&dev->wrbuf_mutex); |
380 | 380 | ||
381 | if(retlen) | 381 | if(retlen) |
382 | *retlen = thislen; | 382 | *retlen = thislen; |
@@ -659,7 +659,7 @@ static struct blkmtd_dev *add_device(char *devname, int readonly, int erase_size | |||
659 | memset(dev, 0, sizeof(struct blkmtd_dev)); | 659 | memset(dev, 0, sizeof(struct blkmtd_dev)); |
660 | dev->blkdev = bdev; | 660 | dev->blkdev = bdev; |
661 | if(!readonly) { | 661 | if(!readonly) { |
662 | init_MUTEX(&dev->wrbuf_mutex); | 662 | mutex_init(&dev->wrbuf_mutex); |
663 | } | 663 | } |
664 | 664 | ||
665 | dev->mtd_info.size = dev->blkdev->bd_inode->i_size & PAGE_MASK; | 665 | dev->mtd_info.size = dev->blkdev->bd_inode->i_size & PAGE_MASK; |