diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/amiflop.c | 4 | ||||
-rw-r--r-- | drivers/block/ataflop.c | 4 | ||||
-rw-r--r-- | drivers/block/floppy.c | 4 | ||||
-rw-r--r-- | drivers/block/paride/pf.c | 2 | ||||
-rw-r--r-- | drivers/block/paride/pt.c | 2 | ||||
-rw-r--r-- | drivers/block/pktcdvd.c | 2 | ||||
-rw-r--r-- | drivers/block/swim3.c | 4 |
7 files changed, 11 insertions, 11 deletions
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c index 7516baff3bb..d19c5a939fe 100644 --- a/drivers/block/amiflop.c +++ b/drivers/block/amiflop.c @@ -1560,9 +1560,9 @@ static int floppy_open(struct inode *inode, struct file *filp) if (fd_ref[drive] && old_dev != system) return -EBUSY; - if (filp && filp->f_mode & 3) { + if (filp && filp->f_mode & (FMODE_READ|FMODE_WRITE)) { check_disk_change(inode->i_bdev); - if (filp->f_mode & 2 ) { + if (filp->f_mode & FMODE_WRITE ) { int wrprot; get_fdc(drive); diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c index 432cf401829..e1db285b72c 100644 --- a/drivers/block/ataflop.c +++ b/drivers/block/ataflop.c @@ -1826,9 +1826,9 @@ static int floppy_open( struct inode *inode, struct file *filp ) if (filp->f_flags & O_NDELAY) return 0; - if (filp->f_mode & 3) { + if (filp->f_mode & (FMODE_READ|FMODE_WRITE)) { check_disk_change(inode->i_bdev); - if (filp->f_mode & 2) { + if (filp->f_mode & FMODE_WRITE) { if (p->wpstat) { if (p->ref < 0) p->ref = 0; diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 2cea27aba9a..ae3ef8945f3 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -3761,14 +3761,14 @@ static int floppy_open(struct inode *inode, struct file *filp) UFDCS->rawcmd = 2; if (!(filp->f_flags & O_NDELAY)) { - if (filp->f_mode & 3) { + if (filp->f_mode & (FMODE_READ|FMODE_WRITE)) { UDRS->last_checked = 0; check_disk_change(inode->i_bdev); if (UTESTF(FD_DISK_CHANGED)) goto out; } res = -EROFS; - if ((filp->f_mode & 2) && !(UTESTF(FD_DISK_WRITABLE))) + if ((filp->f_mode & FMODE_WRITE) && !(UTESTF(FD_DISK_WRITABLE))) goto out; } mutex_unlock(&open_lock); diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c index e7fe6ca97dd..a902d84fd33 100644 --- a/drivers/block/paride/pf.c +++ b/drivers/block/paride/pf.c @@ -305,7 +305,7 @@ static int pf_open(struct inode *inode, struct file *file) if (pf->media_status == PF_NM) return -ENODEV; - if ((pf->media_status == PF_RO) && (file->f_mode & 2)) + if ((pf->media_status == PF_RO) && (file->f_mode & FMODE_WRITE)) return -EROFS; pf->access++; diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c index 5ae229656ea..1e4006e18f0 100644 --- a/drivers/block/paride/pt.c +++ b/drivers/block/paride/pt.c @@ -667,7 +667,7 @@ static int pt_open(struct inode *inode, struct file *file) goto out; err = -EROFS; - if ((!(tape->flags & PT_WRITE_OK)) && (file->f_mode & 2)) + if ((!(tape->flags & PT_WRITE_OK)) && (file->f_mode & FMODE_WRITE)) goto out; if (!(iminor(inode) & 128)) diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 195ca7c720f..4d581e8ba9f 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -2320,7 +2320,7 @@ static int pkt_open_write(struct pktcdvd_device *pd) /* * called at open time. */ -static int pkt_open_dev(struct pktcdvd_device *pd, int write) +static int pkt_open_dev(struct pktcdvd_device *pd, fmode_t write) { int ret; long lba; diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c index 730ccea78e4..a53ca54bee1 100644 --- a/drivers/block/swim3.c +++ b/drivers/block/swim3.c @@ -908,13 +908,13 @@ static int floppy_open(struct inode *inode, struct file *filp) return -EBUSY; if (err == 0 && (filp->f_flags & O_NDELAY) == 0 - && (filp->f_mode & 3)) { + && (filp->f_mode & (FMODE_READ|FMODE_WRITE))) { check_disk_change(inode->i_bdev); if (fs->ejected) err = -ENXIO; } - if (err == 0 && (filp->f_mode & 2)) { + if (err == 0 && (filp->f_mode & FMODE_WRITE)) { if (fs->write_prot < 0) fs->write_prot = swim3_readbit(fs, WRITE_PROT); if (fs->write_prot) |