Commit 0b71bb7f authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] some mtdblock_ro fixes

parent 70f7a7d6
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/compatmac.h> #include <linux/mtd/compatmac.h>
#include <linux/buffer_head.h>
#include <linux/genhd.h>
#define LOCAL_END_REQUEST #define LOCAL_END_REQUEST
#define MAJOR_NR MTD_BLOCK_MAJOR #define MAJOR_NR MTD_BLOCK_MAJOR
...@@ -47,7 +49,7 @@ static int mtdblock_open(struct inode *inode, struct file *file) ...@@ -47,7 +49,7 @@ static int mtdblock_open(struct inode *inode, struct file *file)
return -EINVAL; return -EINVAL;
} }
set_capacit(disk, mtd->size>>9); set_capacity(disk, mtd->size>>9);
add_disk(disk); add_disk(disk);
DEBUG(1, "ok\n"); DEBUG(1, "ok\n");
...@@ -119,7 +121,7 @@ static void mtdblock_request(RQFUNC_ARG) ...@@ -119,7 +121,7 @@ static void mtdblock_request(RQFUNC_ARG)
mtd = __get_mtd_device(NULL, minor(current_request->rq_dev)); mtd = __get_mtd_device(NULL, minor(current_request->rq_dev));
if (!mtd) { if (!mtd) {
printk("MTD device %d doesn't appear to exist any more\n", DEVICE_NR(CURRENT->rq_dev)); printk("MTD device %s doesn't appear to exist any more\n", kdevname(DEVICE_NR(CURRENT->rq_dev)));
mtdblock_end_request(current_request, 0); mtdblock_end_request(current_request, 0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment