aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card/block.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/card/block.c')
-rw-r--r--drivers/mmc/card/block.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 24c97d3d16bb..3d067c35185d 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -92,18 +92,17 @@ static void mmc_blk_put(struct mmc_blk_data *md)
92 mutex_unlock(&open_lock); 92 mutex_unlock(&open_lock);
93} 93}
94 94
95static int mmc_blk_open(struct inode *inode, struct file *filp) 95static int mmc_blk_open(struct block_device *bdev, fmode_t mode)
96{ 96{
97 struct mmc_blk_data *md; 97 struct mmc_blk_data *md = mmc_blk_get(bdev->bd_disk);
98 int ret = -ENXIO; 98 int ret = -ENXIO;
99 99
100 md = mmc_blk_get(inode->i_bdev->bd_disk);
101 if (md) { 100 if (md) {
102 if (md->usage == 2) 101 if (md->usage == 2)
103 check_disk_change(inode->i_bdev); 102 check_disk_change(bdev);
104 ret = 0; 103 ret = 0;
105 104
106 if ((filp->f_mode & FMODE_WRITE) && md->read_only) { 105 if ((mode & FMODE_WRITE) && md->read_only) {
107 mmc_blk_put(md); 106 mmc_blk_put(md);
108 ret = -EROFS; 107 ret = -EROFS;
109 } 108 }
@@ -112,9 +111,9 @@ static int mmc_blk_open(struct inode *inode, struct file *filp)
112 return ret; 111 return ret;
113} 112}
114 113
115static int mmc_blk_release(struct inode *inode, struct file *filp) 114static int mmc_blk_release(struct gendisk *disk, fmode_t mode)
116{ 115{
117 struct mmc_blk_data *md = inode->i_bdev->bd_disk->private_data; 116 struct mmc_blk_data *md = disk->private_data;
118 117
119 mmc_blk_put(md); 118 mmc_blk_put(md);
120 return 0; 119 return 0;