aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/memstick/core/mspro_block.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/memstick/core/mspro_block.c')
-rw-r--r--drivers/memstick/core/mspro_block.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c
index 8327e248520..eef78a068fd 100644
--- a/drivers/memstick/core/mspro_block.c
+++ b/drivers/memstick/core/mspro_block.c
@@ -18,6 +18,7 @@
18#include <linux/kthread.h> 18#include <linux/kthread.h>
19#include <linux/delay.h> 19#include <linux/delay.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/smp_lock.h>
21#include <linux/memstick.h> 22#include <linux/memstick.h>
22 23
23#define DRIVER_NAME "mspro_block" 24#define DRIVER_NAME "mspro_block"
@@ -179,6 +180,7 @@ static int mspro_block_bd_open(struct block_device *bdev, fmode_t mode)
179 struct mspro_block_data *msb = disk->private_data; 180 struct mspro_block_data *msb = disk->private_data;
180 int rc = -ENXIO; 181 int rc = -ENXIO;
181 182
183 lock_kernel();
182 mutex_lock(&mspro_block_disk_lock); 184 mutex_lock(&mspro_block_disk_lock);
183 185
184 if (msb && msb->card) { 186 if (msb && msb->card) {
@@ -190,6 +192,7 @@ static int mspro_block_bd_open(struct block_device *bdev, fmode_t mode)
190 } 192 }
191 193
192 mutex_unlock(&mspro_block_disk_lock); 194 mutex_unlock(&mspro_block_disk_lock);
195 unlock_kernel();
193 196
194 return rc; 197 return rc;
195} 198}
@@ -221,7 +224,11 @@ static int mspro_block_disk_release(struct gendisk *disk)
221 224
222static int mspro_block_bd_release(struct gendisk *disk, fmode_t mode) 225static int mspro_block_bd_release(struct gendisk *disk, fmode_t mode)
223{ 226{
224 return mspro_block_disk_release(disk); 227 int ret;
228 lock_kernel();
229 ret = mspro_block_disk_release(disk);
230 unlock_kernel();
231 return ret;
225} 232}
226 233
227static int mspro_block_bd_getgeo(struct block_device *bdev, 234static int mspro_block_bd_getgeo(struct block_device *bdev,
@@ -805,7 +812,8 @@ static void mspro_block_start(struct memstick_dev *card)
805 812
806static int mspro_block_prepare_req(struct request_queue *q, struct request *req) 813static int mspro_block_prepare_req(struct request_queue *q, struct request *req)
807{ 814{
808 if (!blk_fs_request(req) && !blk_pc_request(req)) { 815 if (req->cmd_type != REQ_TYPE_FS &&
816 req->cmd_type != REQ_TYPE_BLOCK_PC) {
809 blk_dump_rq_flags(req, "MSPro unsupported request"); 817 blk_dump_rq_flags(req, "MSPro unsupported request");
810 return BLKPREP_KILL; 818 return BLKPREP_KILL;
811 } 819 }