Skip to content

Commit

Permalink
[PATCH] switch memstick
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Oct 21, 2008
1 parent a39907f commit 5d9a54b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions drivers/memstick/core/mspro_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,17 @@ static int mspro_block_complete_req(struct memstick_dev *card, int error);

/*** Block device ***/

static int mspro_block_bd_open(struct inode *inode, struct file *filp)
static int mspro_block_bd_open(struct block_device *bdev, fmode_t mode)
{
struct gendisk *disk = inode->i_bdev->bd_disk;
struct gendisk *disk = bdev->bd_disk;
struct mspro_block_data *msb = disk->private_data;
int rc = -ENXIO;

mutex_lock(&mspro_block_disk_lock);

if (msb && msb->card) {
msb->usage_count++;
if ((filp->f_mode & FMODE_WRITE) && msb->read_only)
if ((mode & FMODE_WRITE) && msb->read_only)
rc = -EROFS;
else
rc = 0;
Expand Down Expand Up @@ -218,9 +218,8 @@ static int mspro_block_disk_release(struct gendisk *disk)
return 0;
}

static int mspro_block_bd_release(struct inode *inode, struct file *filp)
static int mspro_block_bd_release(struct gendisk *disk, fmode_t mode)
{
struct gendisk *disk = inode->i_bdev->bd_disk;
return mspro_block_disk_release(disk);
}

Expand All @@ -237,8 +236,8 @@ static int mspro_block_bd_getgeo(struct block_device *bdev,
}

static struct block_device_operations ms_block_bdops = {
.__open = mspro_block_bd_open,
.__release = mspro_block_bd_release,
.open = mspro_block_bd_open,
.release = mspro_block_bd_release,
.getgeo = mspro_block_bd_getgeo,
.owner = THIS_MODULE
};
Expand Down

0 comments on commit 5d9a54b

Please sign in to comment.