aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/memstick/core/mspro_block.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c
index fbe5919789d0..7911151e56a3 100644
--- a/drivers/memstick/core/mspro_block.c
+++ b/drivers/memstick/core/mspro_block.c
@@ -172,9 +172,9 @@ static int mspro_block_complete_req(struct memstick_dev *card, int error);
172 172
173/*** Block device ***/ 173/*** Block device ***/
174 174
175static int mspro_block_bd_open(struct inode *inode, struct file *filp) 175static int mspro_block_bd_open(struct block_device *bdev, fmode_t mode)
176{ 176{
177 struct gendisk *disk = inode->i_bdev->bd_disk; 177 struct gendisk *disk = bdev->bd_disk;
178 struct mspro_block_data *msb = disk->private_data; 178 struct mspro_block_data *msb = disk->private_data;
179 int rc = -ENXIO; 179 int rc = -ENXIO;
180 180
@@ -182,7 +182,7 @@ static int mspro_block_bd_open(struct inode *inode, struct file *filp)
182 182
183 if (msb && msb->card) { 183 if (msb && msb->card) {
184 msb->usage_count++; 184 msb->usage_count++;
185 if ((filp->f_mode & FMODE_WRITE) && msb->read_only) 185 if ((mode & FMODE_WRITE) && msb->read_only)
186 rc = -EROFS; 186 rc = -EROFS;
187 else 187 else
188 rc = 0; 188 rc = 0;
@@ -218,9 +218,8 @@ static int mspro_block_disk_release(struct gendisk *disk)
218 return 0; 218 return 0;
219} 219}
220 220
221static int mspro_block_bd_release(struct inode *inode, struct file *filp) 221static int mspro_block_bd_release(struct gendisk *disk, fmode_t mode)
222{ 222{
223 struct gendisk *disk = inode->i_bdev->bd_disk;
224 return mspro_block_disk_release(disk); 223 return mspro_block_disk_release(disk);
225} 224}
226 225
@@ -237,8 +236,8 @@ static int mspro_block_bd_getgeo(struct block_device *bdev,
237} 236}
238 237
239static struct block_device_operations ms_block_bdops = { 238static struct block_device_operations ms_block_bdops = {
240 .__open = mspro_block_bd_open, 239 .open = mspro_block_bd_open,
241 .__release = mspro_block_bd_release, 240 .release = mspro_block_bd_release,
242 .getgeo = mspro_block_bd_getgeo, 241 .getgeo = mspro_block_bd_getgeo,
243 .owner = THIS_MODULE 242 .owner = THIS_MODULE
244}; 243};