aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/paride/pf.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2008-03-02 09:36:16 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2008-10-21 07:47:59 -0400
commit8cfc7ca40c41e6cb9ee96c149d5b928564d635e4 (patch)
tree7bb3eab7c0e5cddb884ab91cdcb84e9435592ceb /drivers/block/paride/pf.c
parentb6a895307a6a8d8c294c57d319ec05286d181dac (diff)
[PATCH] switch pf
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/block/paride/pf.c')
-rw-r--r--drivers/block/paride/pf.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c
index e08ca5161ad8..bef3b997ba3e 100644
--- a/drivers/block/paride/pf.c
+++ b/drivers/block/paride/pf.c
@@ -201,13 +201,13 @@ module_param_array(drive3, int, NULL, 0);
201#define ATAPI_READ_10 0x28 201#define ATAPI_READ_10 0x28
202#define ATAPI_WRITE_10 0x2a 202#define ATAPI_WRITE_10 0x2a
203 203
204static int pf_open(struct inode *inode, struct file *file); 204static int pf_open(struct block_device *bdev, fmode_t mode);
205static void do_pf_request(struct request_queue * q); 205static void do_pf_request(struct request_queue * q);
206static int pf_ioctl(struct inode *inode, struct file *file, 206static int pf_ioctl(struct block_device *bdev, fmode_t mode,
207 unsigned int cmd, unsigned long arg); 207 unsigned int cmd, unsigned long arg);
208static int pf_getgeo(struct block_device *bdev, struct hd_geometry *geo); 208static int pf_getgeo(struct block_device *bdev, struct hd_geometry *geo);
209 209
210static int pf_release(struct inode *inode, struct file *file); 210static int pf_release(struct gendisk *disk, fmode_t mode);
211 211
212static int pf_detect(void); 212static int pf_detect(void);
213static void do_pf_read(void); 213static void do_pf_read(void);
@@ -264,9 +264,9 @@ static char *pf_buf; /* buffer for request in progress */
264 264
265static struct block_device_operations pf_fops = { 265static struct block_device_operations pf_fops = {
266 .owner = THIS_MODULE, 266 .owner = THIS_MODULE,
267 .__open = pf_open, 267 .open = pf_open,
268 .__release = pf_release, 268 .release = pf_release,
269 .__ioctl = pf_ioctl, 269 .locked_ioctl = pf_ioctl,
270 .getgeo = pf_getgeo, 270 .getgeo = pf_getgeo,
271 .media_changed = pf_check_media, 271 .media_changed = pf_check_media,
272}; 272};
@@ -296,16 +296,16 @@ static void __init pf_init_units(void)
296 } 296 }
297} 297}
298 298
299static int pf_open(struct inode *inode, struct file *file) 299static int pf_open(struct block_device *bdev, fmode_t mode)
300{ 300{
301 struct pf_unit *pf = inode->i_bdev->bd_disk->private_data; 301 struct pf_unit *pf = bdev->bd_disk->private_data;
302 302
303 pf_identify(pf); 303 pf_identify(pf);
304 304
305 if (pf->media_status == PF_NM) 305 if (pf->media_status == PF_NM)
306 return -ENODEV; 306 return -ENODEV;
307 307
308 if ((pf->media_status == PF_RO) && (file->f_mode & FMODE_WRITE)) 308 if ((pf->media_status == PF_RO) && (mode & FMODE_WRITE))
309 return -EROFS; 309 return -EROFS;
310 310
311 pf->access++; 311 pf->access++;
@@ -333,9 +333,9 @@ static int pf_getgeo(struct block_device *bdev, struct hd_geometry *geo)
333 return 0; 333 return 0;
334} 334}
335 335
336static int pf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) 336static int pf_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg)
337{ 337{
338 struct pf_unit *pf = inode->i_bdev->bd_disk->private_data; 338 struct pf_unit *pf = bdev->bd_disk->private_data;
339 339
340 if (cmd != CDROMEJECT) 340 if (cmd != CDROMEJECT)
341 return -EINVAL; 341 return -EINVAL;
@@ -346,9 +346,9 @@ static int pf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
346 return 0; 346 return 0;
347} 347}
348 348
349static int pf_release(struct inode *inode, struct file *file) 349static int pf_release(struct gendisk *disk, fmode_t mode)
350{ 350{
351 struct pf_unit *pf = inode->i_bdev->bd_disk->private_data; 351 struct pf_unit *pf = disk->private_data;
352 352
353 if (pf->access <= 0) 353 if (pf->access <= 0)
354 return -EINVAL; 354 return -EINVAL;