aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card/block.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2008-03-02 10:33:30 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2008-10-21 07:48:37 -0400
commita5a1561f88fe8bfd7fdceed1d942ad494500b8a9 (patch)
tree37b67f85412745f258155795c12988cada3f4491 /drivers/mmc/card/block.c
parentf3f6015bff7a15671bcadfac7215eb33a2bccc9d (diff)
[PATCH] switch mmc
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/mmc/card/block.c')
-rw-r--r--drivers/mmc/card/block.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 8cba06f5e11d..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;
@@ -130,8 +129,8 @@ mmc_blk_getgeo(struct block_device *bdev, struct hd_geometry *geo)
130} 129}
131 130
132static struct block_device_operations mmc_bdops = { 131static struct block_device_operations mmc_bdops = {
133 .__open = mmc_blk_open, 132 .open = mmc_blk_open,
134 .__release = mmc_blk_release, 133 .release = mmc_blk_release,
135 .getgeo = mmc_blk_getgeo, 134 .getgeo = mmc_blk_getgeo,
136 .owner = THIS_MODULE, 135 .owner = THIS_MODULE,
137}; 136};