diff options
37 files changed, 62 insertions, 121 deletions
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 41bf72073ccc..879990cb66c6 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c | |||
@@ -87,7 +87,7 @@ static DEFINE_MUTEX(ubd_lock); | |||
87 | static DEFINE_MUTEX(ubd_mutex); /* replaces BKL, might not be needed */ | 87 | static DEFINE_MUTEX(ubd_mutex); /* replaces BKL, might not be needed */ |
88 | 88 | ||
89 | static int ubd_open(struct block_device *bdev, fmode_t mode); | 89 | static int ubd_open(struct block_device *bdev, fmode_t mode); |
90 | static int ubd_release(struct gendisk *disk, fmode_t mode); | 90 | static void ubd_release(struct gendisk *disk, fmode_t mode); |
91 | static int ubd_ioctl(struct block_device *bdev, fmode_t mode, | 91 | static int ubd_ioctl(struct block_device *bdev, fmode_t mode, |
92 | unsigned int cmd, unsigned long arg); | 92 | unsigned int cmd, unsigned long arg); |
93 | static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo); | 93 | static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo); |
@@ -1138,7 +1138,7 @@ out: | |||
1138 | return err; | 1138 | return err; |
1139 | } | 1139 | } |
1140 | 1140 | ||
1141 | static int ubd_release(struct gendisk *disk, fmode_t mode) | 1141 | static void ubd_release(struct gendisk *disk, fmode_t mode) |
1142 | { | 1142 | { |
1143 | struct ubd *ubd_dev = disk->private_data; | 1143 | struct ubd *ubd_dev = disk->private_data; |
1144 | 1144 | ||
@@ -1146,7 +1146,6 @@ static int ubd_release(struct gendisk *disk, fmode_t mode) | |||
1146 | if(--ubd_dev->count == 0) | 1146 | if(--ubd_dev->count == 0) |
1147 | ubd_close_dev(ubd_dev); | 1147 | ubd_close_dev(ubd_dev); |
1148 | mutex_unlock(&ubd_mutex); | 1148 | mutex_unlock(&ubd_mutex); |
1149 | return 0; | ||
1150 | } | 1149 | } |
1151 | 1150 | ||
1152 | static void cowify_bitmap(__u64 io_offset, int length, unsigned long *cow_mask, | 1151 | static void cowify_bitmap(__u64 io_offset, int length, unsigned long *cow_mask, |
diff --git a/arch/xtensa/platforms/iss/simdisk.c b/arch/xtensa/platforms/iss/simdisk.c index 88608cc11b8c..0345f43d34f3 100644 --- a/arch/xtensa/platforms/iss/simdisk.c +++ b/arch/xtensa/platforms/iss/simdisk.c | |||
@@ -139,13 +139,12 @@ static int simdisk_open(struct block_device *bdev, fmode_t mode) | |||
139 | return 0; | 139 | return 0; |
140 | } | 140 | } |
141 | 141 | ||
142 | static int simdisk_release(struct gendisk *disk, fmode_t mode) | 142 | static void simdisk_release(struct gendisk *disk, fmode_t mode) |
143 | { | 143 | { |
144 | struct simdisk *dev = disk->private_data; | 144 | struct simdisk *dev = disk->private_data; |
145 | spin_lock(&dev->lock); | 145 | spin_lock(&dev->lock); |
146 | --dev->users; | 146 | --dev->users; |
147 | spin_unlock(&dev->lock); | 147 | spin_unlock(&dev->lock); |
148 | return 0; | ||
149 | } | 148 | } |
150 | 149 | ||
151 | static const struct block_device_operations simdisk_ops = { | 150 | static const struct block_device_operations simdisk_ops = { |
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c index 386146d792d1..4ff85b8785ee 100644 --- a/drivers/block/amiflop.c +++ b/drivers/block/amiflop.c | |||
@@ -1634,7 +1634,7 @@ static int floppy_open(struct block_device *bdev, fmode_t mode) | |||
1634 | return 0; | 1634 | return 0; |
1635 | } | 1635 | } |
1636 | 1636 | ||
1637 | static int floppy_release(struct gendisk *disk, fmode_t mode) | 1637 | static void floppy_release(struct gendisk *disk, fmode_t mode) |
1638 | { | 1638 | { |
1639 | struct amiga_floppy_struct *p = disk->private_data; | 1639 | struct amiga_floppy_struct *p = disk->private_data; |
1640 | int drive = p - unit; | 1640 | int drive = p - unit; |
@@ -1654,7 +1654,6 @@ static int floppy_release(struct gendisk *disk, fmode_t mode) | |||
1654 | floppy_off (drive | 0x40000000); | 1654 | floppy_off (drive | 0x40000000); |
1655 | #endif | 1655 | #endif |
1656 | mutex_unlock(&amiflop_mutex); | 1656 | mutex_unlock(&amiflop_mutex); |
1657 | return 0; | ||
1658 | } | 1657 | } |
1659 | 1658 | ||
1660 | /* | 1659 | /* |
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c index a129f8c8073d..916d9ed5c8aa 100644 --- a/drivers/block/aoe/aoeblk.c +++ b/drivers/block/aoe/aoeblk.c | |||
@@ -169,7 +169,7 @@ aoeblk_open(struct block_device *bdev, fmode_t mode) | |||
169 | return -ENODEV; | 169 | return -ENODEV; |
170 | } | 170 | } |
171 | 171 | ||
172 | static int | 172 | static void |
173 | aoeblk_release(struct gendisk *disk, fmode_t mode) | 173 | aoeblk_release(struct gendisk *disk, fmode_t mode) |
174 | { | 174 | { |
175 | struct aoedev *d = disk->private_data; | 175 | struct aoedev *d = disk->private_data; |
@@ -180,11 +180,9 @@ aoeblk_release(struct gendisk *disk, fmode_t mode) | |||
180 | if (--d->nopen == 0) { | 180 | if (--d->nopen == 0) { |
181 | spin_unlock_irqrestore(&d->lock, flags); | 181 | spin_unlock_irqrestore(&d->lock, flags); |
182 | aoecmd_cfg(d->aoemajor, d->aoeminor); | 182 | aoecmd_cfg(d->aoemajor, d->aoeminor); |
183 | return 0; | 183 | return; |
184 | } | 184 | } |
185 | spin_unlock_irqrestore(&d->lock, flags); | 185 | spin_unlock_irqrestore(&d->lock, flags); |
186 | |||
187 | return 0; | ||
188 | } | 186 | } |
189 | 187 | ||
190 | static void | 188 | static void |
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c index ede16c64ff07..0e30c6e5492a 100644 --- a/drivers/block/ataflop.c +++ b/drivers/block/ataflop.c | |||
@@ -367,7 +367,7 @@ static void fd_probe( int drive ); | |||
367 | static int fd_test_drive_present( int drive ); | 367 | static int fd_test_drive_present( int drive ); |
368 | static void config_types( void ); | 368 | static void config_types( void ); |
369 | static int floppy_open(struct block_device *bdev, fmode_t mode); | 369 | static int floppy_open(struct block_device *bdev, fmode_t mode); |
370 | static int floppy_release(struct gendisk *disk, fmode_t mode); | 370 | static void floppy_release(struct gendisk *disk, fmode_t mode); |
371 | 371 | ||
372 | /************************* End of Prototypes **************************/ | 372 | /************************* End of Prototypes **************************/ |
373 | 373 | ||
@@ -1886,7 +1886,7 @@ static int floppy_unlocked_open(struct block_device *bdev, fmode_t mode) | |||
1886 | return ret; | 1886 | return ret; |
1887 | } | 1887 | } |
1888 | 1888 | ||
1889 | static int floppy_release(struct gendisk *disk, fmode_t mode) | 1889 | static void floppy_release(struct gendisk *disk, fmode_t mode) |
1890 | { | 1890 | { |
1891 | struct atari_floppy_struct *p = disk->private_data; | 1891 | struct atari_floppy_struct *p = disk->private_data; |
1892 | mutex_lock(&ataflop_mutex); | 1892 | mutex_lock(&ataflop_mutex); |
@@ -1897,7 +1897,6 @@ static int floppy_release(struct gendisk *disk, fmode_t mode) | |||
1897 | p->ref = 0; | 1897 | p->ref = 0; |
1898 | } | 1898 | } |
1899 | mutex_unlock(&ataflop_mutex); | 1899 | mutex_unlock(&ataflop_mutex); |
1900 | return 0; | ||
1901 | } | 1900 | } |
1902 | 1901 | ||
1903 | static const struct block_device_operations floppy_fops = { | 1902 | static const struct block_device_operations floppy_fops = { |
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index e18c99140c0a..94b51c5e0678 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -161,7 +161,7 @@ static irqreturn_t do_cciss_intx(int irq, void *dev_id); | |||
161 | static irqreturn_t do_cciss_msix_intr(int irq, void *dev_id); | 161 | static irqreturn_t do_cciss_msix_intr(int irq, void *dev_id); |
162 | static int cciss_open(struct block_device *bdev, fmode_t mode); | 162 | static int cciss_open(struct block_device *bdev, fmode_t mode); |
163 | static int cciss_unlocked_open(struct block_device *bdev, fmode_t mode); | 163 | static int cciss_unlocked_open(struct block_device *bdev, fmode_t mode); |
164 | static int cciss_release(struct gendisk *disk, fmode_t mode); | 164 | static void cciss_release(struct gendisk *disk, fmode_t mode); |
165 | static int do_ioctl(struct block_device *bdev, fmode_t mode, | 165 | static int do_ioctl(struct block_device *bdev, fmode_t mode, |
166 | unsigned int cmd, unsigned long arg); | 166 | unsigned int cmd, unsigned long arg); |
167 | static int cciss_ioctl(struct block_device *bdev, fmode_t mode, | 167 | static int cciss_ioctl(struct block_device *bdev, fmode_t mode, |
@@ -1123,7 +1123,7 @@ static int cciss_unlocked_open(struct block_device *bdev, fmode_t mode) | |||
1123 | /* | 1123 | /* |
1124 | * Close. Sync first. | 1124 | * Close. Sync first. |
1125 | */ | 1125 | */ |
1126 | static int cciss_release(struct gendisk *disk, fmode_t mode) | 1126 | static void cciss_release(struct gendisk *disk, fmode_t mode) |
1127 | { | 1127 | { |
1128 | ctlr_info_t *h; | 1128 | ctlr_info_t *h; |
1129 | drive_info_struct *drv; | 1129 | drive_info_struct *drv; |
@@ -1135,7 +1135,6 @@ static int cciss_release(struct gendisk *disk, fmode_t mode) | |||
1135 | drv->usage_count--; | 1135 | drv->usage_count--; |
1136 | h->usage_count--; | 1136 | h->usage_count--; |
1137 | mutex_unlock(&cciss_mutex); | 1137 | mutex_unlock(&cciss_mutex); |
1138 | return 0; | ||
1139 | } | 1138 | } |
1140 | 1139 | ||
1141 | static int do_ioctl(struct block_device *bdev, fmode_t mode, | 1140 | static int do_ioctl(struct block_device *bdev, fmode_t mode, |
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c index 3b9e8ebcb96b..639d26b90b91 100644 --- a/drivers/block/cpqarray.c +++ b/drivers/block/cpqarray.c | |||
@@ -160,7 +160,7 @@ static int sendcmd( | |||
160 | unsigned int log_unit ); | 160 | unsigned int log_unit ); |
161 | 161 | ||
162 | static int ida_unlocked_open(struct block_device *bdev, fmode_t mode); | 162 | static int ida_unlocked_open(struct block_device *bdev, fmode_t mode); |
163 | static int ida_release(struct gendisk *disk, fmode_t mode); | 163 | static void ida_release(struct gendisk *disk, fmode_t mode); |
164 | static int ida_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg); | 164 | static int ida_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg); |
165 | static int ida_getgeo(struct block_device *bdev, struct hd_geometry *geo); | 165 | static int ida_getgeo(struct block_device *bdev, struct hd_geometry *geo); |
166 | static int ida_ctlr_ioctl(ctlr_info_t *h, int dsk, ida_ioctl_t *io); | 166 | static int ida_ctlr_ioctl(ctlr_info_t *h, int dsk, ida_ioctl_t *io); |
@@ -856,7 +856,7 @@ static int ida_unlocked_open(struct block_device *bdev, fmode_t mode) | |||
856 | /* | 856 | /* |
857 | * Close. Sync first. | 857 | * Close. Sync first. |
858 | */ | 858 | */ |
859 | static int ida_release(struct gendisk *disk, fmode_t mode) | 859 | static void ida_release(struct gendisk *disk, fmode_t mode) |
860 | { | 860 | { |
861 | ctlr_info_t *host; | 861 | ctlr_info_t *host; |
862 | 862 | ||
@@ -864,8 +864,6 @@ static int ida_release(struct gendisk *disk, fmode_t mode) | |||
864 | host = get_host(disk); | 864 | host = get_host(disk); |
865 | host->usage_count--; | 865 | host->usage_count--; |
866 | mutex_unlock(&cpqarray_mutex); | 866 | mutex_unlock(&cpqarray_mutex); |
867 | |||
868 | return 0; | ||
869 | } | 867 | } |
870 | 868 | ||
871 | /* | 869 | /* |
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index e98da675f0c1..298b868910dc 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -63,7 +63,7 @@ int drbd_asender(struct drbd_thread *); | |||
63 | 63 | ||
64 | int drbd_init(void); | 64 | int drbd_init(void); |
65 | static int drbd_open(struct block_device *bdev, fmode_t mode); | 65 | static int drbd_open(struct block_device *bdev, fmode_t mode); |
66 | static int drbd_release(struct gendisk *gd, fmode_t mode); | 66 | static void drbd_release(struct gendisk *gd, fmode_t mode); |
67 | static int w_md_sync(struct drbd_work *w, int unused); | 67 | static int w_md_sync(struct drbd_work *w, int unused); |
68 | static void md_sync_timer_fn(unsigned long data); | 68 | static void md_sync_timer_fn(unsigned long data); |
69 | static int w_bitmap_io(struct drbd_work *w, int unused); | 69 | static int w_bitmap_io(struct drbd_work *w, int unused); |
@@ -1849,13 +1849,12 @@ static int drbd_open(struct block_device *bdev, fmode_t mode) | |||
1849 | return rv; | 1849 | return rv; |
1850 | } | 1850 | } |
1851 | 1851 | ||
1852 | static int drbd_release(struct gendisk *gd, fmode_t mode) | 1852 | static void drbd_release(struct gendisk *gd, fmode_t mode) |
1853 | { | 1853 | { |
1854 | struct drbd_conf *mdev = gd->private_data; | 1854 | struct drbd_conf *mdev = gd->private_data; |
1855 | mutex_lock(&drbd_main_mutex); | 1855 | mutex_lock(&drbd_main_mutex); |
1856 | mdev->open_cnt--; | 1856 | mdev->open_cnt--; |
1857 | mutex_unlock(&drbd_main_mutex); | 1857 | mutex_unlock(&drbd_main_mutex); |
1858 | return 0; | ||
1859 | } | 1858 | } |
1860 | 1859 | ||
1861 | static void drbd_set_defaults(struct drbd_conf *mdev) | 1860 | static void drbd_set_defaults(struct drbd_conf *mdev) |
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 2ddd64a9ffde..c49e85608101 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -3601,7 +3601,7 @@ static void __init config_types(void) | |||
3601 | pr_cont("\n"); | 3601 | pr_cont("\n"); |
3602 | } | 3602 | } |
3603 | 3603 | ||
3604 | static int floppy_release(struct gendisk *disk, fmode_t mode) | 3604 | static void floppy_release(struct gendisk *disk, fmode_t mode) |
3605 | { | 3605 | { |
3606 | int drive = (long)disk->private_data; | 3606 | int drive = (long)disk->private_data; |
3607 | 3607 | ||
@@ -3615,8 +3615,6 @@ static int floppy_release(struct gendisk *disk, fmode_t mode) | |||
3615 | opened_bdev[drive] = NULL; | 3615 | opened_bdev[drive] = NULL; |
3616 | mutex_unlock(&open_lock); | 3616 | mutex_unlock(&open_lock); |
3617 | mutex_unlock(&floppy_mutex); | 3617 | mutex_unlock(&floppy_mutex); |
3618 | |||
3619 | return 0; | ||
3620 | } | 3618 | } |
3621 | 3619 | ||
3622 | /* | 3620 | /* |
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index b2955b3f2cbc..d92d50fd84b7 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
@@ -1518,7 +1518,7 @@ out: | |||
1518 | return err; | 1518 | return err; |
1519 | } | 1519 | } |
1520 | 1520 | ||
1521 | static int lo_release(struct gendisk *disk, fmode_t mode) | 1521 | static void lo_release(struct gendisk *disk, fmode_t mode) |
1522 | { | 1522 | { |
1523 | struct loop_device *lo = disk->private_data; | 1523 | struct loop_device *lo = disk->private_data; |
1524 | int err; | 1524 | int err; |
@@ -1535,7 +1535,7 @@ static int lo_release(struct gendisk *disk, fmode_t mode) | |||
1535 | */ | 1535 | */ |
1536 | err = loop_clr_fd(lo); | 1536 | err = loop_clr_fd(lo); |
1537 | if (!err) | 1537 | if (!err) |
1538 | goto out_unlocked; | 1538 | return; |
1539 | } else { | 1539 | } else { |
1540 | /* | 1540 | /* |
1541 | * Otherwise keep thread (if running) and config, | 1541 | * Otherwise keep thread (if running) and config, |
@@ -1546,8 +1546,6 @@ static int lo_release(struct gendisk *disk, fmode_t mode) | |||
1546 | 1546 | ||
1547 | out: | 1547 | out: |
1548 | mutex_unlock(&lo->lo_ctl_mutex); | 1548 | mutex_unlock(&lo->lo_ctl_mutex); |
1549 | out_unlocked: | ||
1550 | return 0; | ||
1551 | } | 1549 | } |
1552 | 1550 | ||
1553 | static const struct block_device_operations lo_fops = { | 1551 | static const struct block_device_operations lo_fops = { |
diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c index ba2b6b5e5910..e76bdc074dbe 100644 --- a/drivers/block/paride/pcd.c +++ b/drivers/block/paride/pcd.c | |||
@@ -236,13 +236,12 @@ static int pcd_block_open(struct block_device *bdev, fmode_t mode) | |||
236 | return ret; | 236 | return ret; |
237 | } | 237 | } |
238 | 238 | ||
239 | static int pcd_block_release(struct gendisk *disk, fmode_t mode) | 239 | static void pcd_block_release(struct gendisk *disk, fmode_t mode) |
240 | { | 240 | { |
241 | struct pcd_unit *cd = disk->private_data; | 241 | struct pcd_unit *cd = disk->private_data; |
242 | mutex_lock(&pcd_mutex); | 242 | mutex_lock(&pcd_mutex); |
243 | cdrom_release(&cd->info, mode); | 243 | cdrom_release(&cd->info, mode); |
244 | mutex_unlock(&pcd_mutex); | 244 | mutex_unlock(&pcd_mutex); |
245 | return 0; | ||
246 | } | 245 | } |
247 | 246 | ||
248 | static int pcd_block_ioctl(struct block_device *bdev, fmode_t mode, | 247 | static int pcd_block_ioctl(struct block_device *bdev, fmode_t mode, |
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c index 831e3ac156e6..19ad8f0c83ef 100644 --- a/drivers/block/paride/pd.c +++ b/drivers/block/paride/pd.c | |||
@@ -783,7 +783,7 @@ static int pd_ioctl(struct block_device *bdev, fmode_t mode, | |||
783 | } | 783 | } |
784 | } | 784 | } |
785 | 785 | ||
786 | static int pd_release(struct gendisk *p, fmode_t mode) | 786 | static void pd_release(struct gendisk *p, fmode_t mode) |
787 | { | 787 | { |
788 | struct pd_unit *disk = p->private_data; | 788 | struct pd_unit *disk = p->private_data; |
789 | 789 | ||
@@ -791,8 +791,6 @@ static int pd_release(struct gendisk *p, fmode_t mode) | |||
791 | if (!--disk->access && disk->removable) | 791 | if (!--disk->access && disk->removable) |
792 | pd_special_command(disk, pd_door_unlock); | 792 | pd_special_command(disk, pd_door_unlock); |
793 | mutex_unlock(&pd_mutex); | 793 | mutex_unlock(&pd_mutex); |
794 | |||
795 | return 0; | ||
796 | } | 794 | } |
797 | 795 | ||
798 | static unsigned int pd_check_events(struct gendisk *p, unsigned int clearing) | 796 | static unsigned int pd_check_events(struct gendisk *p, unsigned int clearing) |
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c index ec8f9ed6326e..f5c86d523ba0 100644 --- a/drivers/block/paride/pf.c +++ b/drivers/block/paride/pf.c | |||
@@ -211,7 +211,7 @@ static int pf_ioctl(struct block_device *bdev, fmode_t mode, | |||
211 | unsigned int cmd, unsigned long arg); | 211 | unsigned int cmd, unsigned long arg); |
212 | static int pf_getgeo(struct block_device *bdev, struct hd_geometry *geo); | 212 | static int pf_getgeo(struct block_device *bdev, struct hd_geometry *geo); |
213 | 213 | ||
214 | static int pf_release(struct gendisk *disk, fmode_t mode); | 214 | static void pf_release(struct gendisk *disk, fmode_t mode); |
215 | 215 | ||
216 | static int pf_detect(void); | 216 | static int pf_detect(void); |
217 | static void do_pf_read(void); | 217 | static void do_pf_read(void); |
@@ -360,14 +360,15 @@ static int pf_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, u | |||
360 | return 0; | 360 | return 0; |
361 | } | 361 | } |
362 | 362 | ||
363 | static int pf_release(struct gendisk *disk, fmode_t mode) | 363 | static void pf_release(struct gendisk *disk, fmode_t mode) |
364 | { | 364 | { |
365 | struct pf_unit *pf = disk->private_data; | 365 | struct pf_unit *pf = disk->private_data; |
366 | 366 | ||
367 | mutex_lock(&pf_mutex); | 367 | mutex_lock(&pf_mutex); |
368 | if (pf->access <= 0) { | 368 | if (pf->access <= 0) { |
369 | mutex_unlock(&pf_mutex); | 369 | mutex_unlock(&pf_mutex); |
370 | return -EINVAL; | 370 | WARN_ON(1); |
371 | return; | ||
371 | } | 372 | } |
372 | 373 | ||
373 | pf->access--; | 374 | pf->access--; |
@@ -376,8 +377,6 @@ static int pf_release(struct gendisk *disk, fmode_t mode) | |||
376 | pf_lock(pf, 0); | 377 | pf_lock(pf, 0); |
377 | 378 | ||
378 | mutex_unlock(&pf_mutex); | 379 | mutex_unlock(&pf_mutex); |
379 | return 0; | ||
380 | |||
381 | } | 380 | } |
382 | 381 | ||
383 | static unsigned int pf_check_events(struct gendisk *disk, unsigned int clearing) | 382 | static unsigned int pf_check_events(struct gendisk *disk, unsigned int clearing) |
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index e0588c6dd86f..9f2d348f7115 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -2376,10 +2376,9 @@ out: | |||
2376 | return ret; | 2376 | return ret; |
2377 | } | 2377 | } |
2378 | 2378 | ||
2379 | static int pkt_close(struct gendisk *disk, fmode_t mode) | 2379 | static void pkt_close(struct gendisk *disk, fmode_t mode) |
2380 | { | 2380 | { |
2381 | struct pktcdvd_device *pd = disk->private_data; | 2381 | struct pktcdvd_device *pd = disk->private_data; |
2382 | int ret = 0; | ||
2383 | 2382 | ||
2384 | mutex_lock(&pktcdvd_mutex); | 2383 | mutex_lock(&pktcdvd_mutex); |
2385 | mutex_lock(&ctl_mutex); | 2384 | mutex_lock(&ctl_mutex); |
@@ -2391,7 +2390,6 @@ static int pkt_close(struct gendisk *disk, fmode_t mode) | |||
2391 | } | 2390 | } |
2392 | mutex_unlock(&ctl_mutex); | 2391 | mutex_unlock(&ctl_mutex); |
2393 | mutex_unlock(&pktcdvd_mutex); | 2392 | mutex_unlock(&pktcdvd_mutex); |
2394 | return ret; | ||
2395 | } | 2393 | } |
2396 | 2394 | ||
2397 | 2395 | ||
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index b7b7a88d9f68..04ca496485b0 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -411,7 +411,7 @@ static int rbd_open(struct block_device *bdev, fmode_t mode) | |||
411 | return 0; | 411 | return 0; |
412 | } | 412 | } |
413 | 413 | ||
414 | static int rbd_release(struct gendisk *disk, fmode_t mode) | 414 | static void rbd_release(struct gendisk *disk, fmode_t mode) |
415 | { | 415 | { |
416 | struct rbd_device *rbd_dev = disk->private_data; | 416 | struct rbd_device *rbd_dev = disk->private_data; |
417 | unsigned long open_count_before; | 417 | unsigned long open_count_before; |
@@ -424,8 +424,6 @@ static int rbd_release(struct gendisk *disk, fmode_t mode) | |||
424 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); | 424 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); |
425 | put_device(&rbd_dev->dev); | 425 | put_device(&rbd_dev->dev); |
426 | mutex_unlock(&ctl_mutex); | 426 | mutex_unlock(&ctl_mutex); |
427 | |||
428 | return 0; | ||
429 | } | 427 | } |
430 | 428 | ||
431 | static const struct block_device_operations rbd_bd_ops = { | 429 | static const struct block_device_operations rbd_bd_ops = { |
diff --git a/drivers/block/swim.c b/drivers/block/swim.c index 8766a2257091..2f445b7a174e 100644 --- a/drivers/block/swim.c +++ b/drivers/block/swim.c | |||
@@ -673,7 +673,7 @@ static int floppy_unlocked_open(struct block_device *bdev, fmode_t mode) | |||
673 | return ret; | 673 | return ret; |
674 | } | 674 | } |
675 | 675 | ||
676 | static int floppy_release(struct gendisk *disk, fmode_t mode) | 676 | static void floppy_release(struct gendisk *disk, fmode_t mode) |
677 | { | 677 | { |
678 | struct floppy_state *fs = disk->private_data; | 678 | struct floppy_state *fs = disk->private_data; |
679 | struct swim __iomem *base = fs->swd->base; | 679 | struct swim __iomem *base = fs->swd->base; |
@@ -687,8 +687,6 @@ static int floppy_release(struct gendisk *disk, fmode_t mode) | |||
687 | if (fs->ref_count == 0) | 687 | if (fs->ref_count == 0) |
688 | swim_motor(base, OFF); | 688 | swim_motor(base, OFF); |
689 | mutex_unlock(&swim_mutex); | 689 | mutex_unlock(&swim_mutex); |
690 | |||
691 | return 0; | ||
692 | } | 690 | } |
693 | 691 | ||
694 | static int floppy_ioctl(struct block_device *bdev, fmode_t mode, | 692 | static int floppy_ioctl(struct block_device *bdev, fmode_t mode, |
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c index 758f2ac878cf..20e061c3e023 100644 --- a/drivers/block/swim3.c +++ b/drivers/block/swim3.c | |||
@@ -251,7 +251,7 @@ static int fd_eject(struct floppy_state *fs); | |||
251 | static int floppy_ioctl(struct block_device *bdev, fmode_t mode, | 251 | static int floppy_ioctl(struct block_device *bdev, fmode_t mode, |
252 | unsigned int cmd, unsigned long param); | 252 | unsigned int cmd, unsigned long param); |
253 | static int floppy_open(struct block_device *bdev, fmode_t mode); | 253 | static int floppy_open(struct block_device *bdev, fmode_t mode); |
254 | static int floppy_release(struct gendisk *disk, fmode_t mode); | 254 | static void floppy_release(struct gendisk *disk, fmode_t mode); |
255 | static unsigned int floppy_check_events(struct gendisk *disk, | 255 | static unsigned int floppy_check_events(struct gendisk *disk, |
256 | unsigned int clearing); | 256 | unsigned int clearing); |
257 | static int floppy_revalidate(struct gendisk *disk); | 257 | static int floppy_revalidate(struct gendisk *disk); |
@@ -1017,7 +1017,7 @@ static int floppy_unlocked_open(struct block_device *bdev, fmode_t mode) | |||
1017 | return ret; | 1017 | return ret; |
1018 | } | 1018 | } |
1019 | 1019 | ||
1020 | static int floppy_release(struct gendisk *disk, fmode_t mode) | 1020 | static void floppy_release(struct gendisk *disk, fmode_t mode) |
1021 | { | 1021 | { |
1022 | struct floppy_state *fs = disk->private_data; | 1022 | struct floppy_state *fs = disk->private_data; |
1023 | struct swim3 __iomem *sw = fs->swim3; | 1023 | struct swim3 __iomem *sw = fs->swim3; |
@@ -1029,7 +1029,6 @@ static int floppy_release(struct gendisk *disk, fmode_t mode) | |||
1029 | swim3_select(fs, RELAX); | 1029 | swim3_select(fs, RELAX); |
1030 | } | 1030 | } |
1031 | mutex_unlock(&swim3_mutex); | 1031 | mutex_unlock(&swim3_mutex); |
1032 | return 0; | ||
1033 | } | 1032 | } |
1034 | 1033 | ||
1035 | static unsigned int floppy_check_events(struct gendisk *disk, | 1034 | static unsigned int floppy_check_events(struct gendisk *disk, |
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index a894f88762d8..d89ef86220f4 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -1617,7 +1617,7 @@ out: | |||
1617 | return err; | 1617 | return err; |
1618 | } | 1618 | } |
1619 | 1619 | ||
1620 | static int blkif_release(struct gendisk *disk, fmode_t mode) | 1620 | static void blkif_release(struct gendisk *disk, fmode_t mode) |
1621 | { | 1621 | { |
1622 | struct blkfront_info *info = disk->private_data; | 1622 | struct blkfront_info *info = disk->private_data; |
1623 | struct block_device *bdev; | 1623 | struct block_device *bdev; |
@@ -1658,7 +1658,6 @@ static int blkif_release(struct gendisk *disk, fmode_t mode) | |||
1658 | out: | 1658 | out: |
1659 | bdput(bdev); | 1659 | bdput(bdev); |
1660 | mutex_unlock(&blkfront_mutex); | 1660 | mutex_unlock(&blkfront_mutex); |
1661 | return 0; | ||
1662 | } | 1661 | } |
1663 | 1662 | ||
1664 | static const struct block_device_operations xlvbd_block_fops = | 1663 | static const struct block_device_operations xlvbd_block_fops = |
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c index 1f38643173ca..f8ef15f37c5e 100644 --- a/drivers/block/xsysace.c +++ b/drivers/block/xsysace.c | |||
@@ -915,7 +915,7 @@ static int ace_open(struct block_device *bdev, fmode_t mode) | |||
915 | return 0; | 915 | return 0; |
916 | } | 916 | } |
917 | 917 | ||
918 | static int ace_release(struct gendisk *disk, fmode_t mode) | 918 | static void ace_release(struct gendisk *disk, fmode_t mode) |
919 | { | 919 | { |
920 | struct ace_device *ace = disk->private_data; | 920 | struct ace_device *ace = disk->private_data; |
921 | unsigned long flags; | 921 | unsigned long flags; |
@@ -932,7 +932,6 @@ static int ace_release(struct gendisk *disk, fmode_t mode) | |||
932 | } | 932 | } |
933 | spin_unlock_irqrestore(&ace->lock, flags); | 933 | spin_unlock_irqrestore(&ace->lock, flags); |
934 | mutex_unlock(&xsysace_mutex); | 934 | mutex_unlock(&xsysace_mutex); |
935 | return 0; | ||
936 | } | 935 | } |
937 | 936 | ||
938 | static int ace_getgeo(struct block_device *bdev, struct hd_geometry *geo) | 937 | static int ace_getgeo(struct block_device *bdev, struct hd_geometry *geo) |
diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c index a22e3f895947..5a95baf4b104 100644 --- a/drivers/block/z2ram.c +++ b/drivers/block/z2ram.c | |||
@@ -309,20 +309,18 @@ err_out: | |||
309 | return rc; | 309 | return rc; |
310 | } | 310 | } |
311 | 311 | ||
312 | static int | 312 | static void |
313 | z2_release(struct gendisk *disk, fmode_t mode) | 313 | z2_release(struct gendisk *disk, fmode_t mode) |
314 | { | 314 | { |
315 | mutex_lock(&z2ram_mutex); | 315 | mutex_lock(&z2ram_mutex); |
316 | if ( current_device == -1 ) { | 316 | if ( current_device == -1 ) { |
317 | mutex_unlock(&z2ram_mutex); | 317 | mutex_unlock(&z2ram_mutex); |
318 | return 0; | 318 | return; |
319 | } | 319 | } |
320 | mutex_unlock(&z2ram_mutex); | 320 | mutex_unlock(&z2ram_mutex); |
321 | /* | 321 | /* |
322 | * FIXME: unmap memory | 322 | * FIXME: unmap memory |
323 | */ | 323 | */ |
324 | |||
325 | return 0; | ||
326 | } | 324 | } |
327 | 325 | ||
328 | static const struct block_device_operations z2_fops = | 326 | static const struct block_device_operations z2_fops = |
diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c index d59cdcb8fe39..4afcb65cc623 100644 --- a/drivers/cdrom/gdrom.c +++ b/drivers/cdrom/gdrom.c | |||
@@ -503,12 +503,11 @@ static int gdrom_bdops_open(struct block_device *bdev, fmode_t mode) | |||
503 | return ret; | 503 | return ret; |
504 | } | 504 | } |
505 | 505 | ||
506 | static int gdrom_bdops_release(struct gendisk *disk, fmode_t mode) | 506 | static void gdrom_bdops_release(struct gendisk *disk, fmode_t mode) |
507 | { | 507 | { |
508 | mutex_lock(&gdrom_mutex); | 508 | mutex_lock(&gdrom_mutex); |
509 | cdrom_release(gd.cd_info, mode); | 509 | cdrom_release(gd.cd_info, mode); |
510 | mutex_unlock(&gdrom_mutex); | 510 | mutex_unlock(&gdrom_mutex); |
511 | return 0; | ||
512 | } | 511 | } |
513 | 512 | ||
514 | static unsigned int gdrom_bdops_check_events(struct gendisk *disk, | 513 | static unsigned int gdrom_bdops_check_events(struct gendisk *disk, |
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index b23113926388..2ff620444930 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -1606,7 +1606,7 @@ out: | |||
1606 | return rc; | 1606 | return rc; |
1607 | } | 1607 | } |
1608 | 1608 | ||
1609 | static int idecd_release(struct gendisk *disk, fmode_t mode) | 1609 | static void idecd_release(struct gendisk *disk, fmode_t mode) |
1610 | { | 1610 | { |
1611 | struct cdrom_info *info = ide_drv_g(disk, cdrom_info); | 1611 | struct cdrom_info *info = ide_drv_g(disk, cdrom_info); |
1612 | 1612 | ||
@@ -1615,8 +1615,6 @@ static int idecd_release(struct gendisk *disk, fmode_t mode) | |||
1615 | 1615 | ||
1616 | ide_cd_put(info); | 1616 | ide_cd_put(info); |
1617 | mutex_unlock(&ide_cd_mutex); | 1617 | mutex_unlock(&ide_cd_mutex); |
1618 | |||
1619 | return 0; | ||
1620 | } | 1618 | } |
1621 | 1619 | ||
1622 | static int idecd_set_spindown(struct cdrom_device_info *cdi, unsigned long arg) | 1620 | static int idecd_set_spindown(struct cdrom_device_info *cdi, unsigned long arg) |
diff --git a/drivers/ide/ide-gd.c b/drivers/ide/ide-gd.c index 70ea8763567d..de86631e767d 100644 --- a/drivers/ide/ide-gd.c +++ b/drivers/ide/ide-gd.c | |||
@@ -250,7 +250,7 @@ static int ide_gd_unlocked_open(struct block_device *bdev, fmode_t mode) | |||
250 | } | 250 | } |
251 | 251 | ||
252 | 252 | ||
253 | static int ide_gd_release(struct gendisk *disk, fmode_t mode) | 253 | static void ide_gd_release(struct gendisk *disk, fmode_t mode) |
254 | { | 254 | { |
255 | struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj); | 255 | struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj); |
256 | ide_drive_t *drive = idkp->drive; | 256 | ide_drive_t *drive = idkp->drive; |
@@ -270,8 +270,6 @@ static int ide_gd_release(struct gendisk *disk, fmode_t mode) | |||
270 | 270 | ||
271 | ide_disk_put(idkp); | 271 | ide_disk_put(idkp); |
272 | mutex_unlock(&ide_gd_mutex); | 272 | mutex_unlock(&ide_gd_mutex); |
273 | |||
274 | return 0; | ||
275 | } | 273 | } |
276 | 274 | ||
277 | static int ide_gd_getgeo(struct block_device *bdev, struct hd_geometry *geo) | 275 | static int ide_gd_getgeo(struct block_device *bdev, struct hd_geometry *geo) |
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 89f859591bbb..c6c574bd5f59 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -1918,15 +1918,13 @@ static int idetape_open(struct block_device *bdev, fmode_t mode) | |||
1918 | return 0; | 1918 | return 0; |
1919 | } | 1919 | } |
1920 | 1920 | ||
1921 | static int idetape_release(struct gendisk *disk, fmode_t mode) | 1921 | static void idetape_release(struct gendisk *disk, fmode_t mode) |
1922 | { | 1922 | { |
1923 | struct ide_tape_obj *tape = ide_drv_g(disk, ide_tape_obj); | 1923 | struct ide_tape_obj *tape = ide_drv_g(disk, ide_tape_obj); |
1924 | 1924 | ||
1925 | mutex_lock(&ide_tape_mutex); | 1925 | mutex_lock(&ide_tape_mutex); |
1926 | ide_tape_put(tape); | 1926 | ide_tape_put(tape); |
1927 | mutex_unlock(&ide_tape_mutex); | 1927 | mutex_unlock(&ide_tape_mutex); |
1928 | |||
1929 | return 0; | ||
1930 | } | 1928 | } |
1931 | 1929 | ||
1932 | static int idetape_ioctl(struct block_device *bdev, fmode_t mode, | 1930 | static int idetape_ioctl(struct block_device *bdev, fmode_t mode, |
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 9a0bdad9ad8f..d5370a94b2c1 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -339,7 +339,7 @@ out: | |||
339 | return md ? 0 : -ENXIO; | 339 | return md ? 0 : -ENXIO; |
340 | } | 340 | } |
341 | 341 | ||
342 | static int dm_blk_close(struct gendisk *disk, fmode_t mode) | 342 | static void dm_blk_close(struct gendisk *disk, fmode_t mode) |
343 | { | 343 | { |
344 | struct mapped_device *md = disk->private_data; | 344 | struct mapped_device *md = disk->private_data; |
345 | 345 | ||
@@ -349,8 +349,6 @@ static int dm_blk_close(struct gendisk *disk, fmode_t mode) | |||
349 | dm_put(md); | 349 | dm_put(md); |
350 | 350 | ||
351 | spin_unlock(&_minor_lock); | 351 | spin_unlock(&_minor_lock); |
352 | |||
353 | return 0; | ||
354 | } | 352 | } |
355 | 353 | ||
356 | int dm_open_count(struct mapped_device *md) | 354 | int dm_open_count(struct mapped_device *md) |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 4c74424c78b0..6330c727396c 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -6674,15 +6674,13 @@ static int md_open(struct block_device *bdev, fmode_t mode) | |||
6674 | return err; | 6674 | return err; |
6675 | } | 6675 | } |
6676 | 6676 | ||
6677 | static int md_release(struct gendisk *disk, fmode_t mode) | 6677 | static void md_release(struct gendisk *disk, fmode_t mode) |
6678 | { | 6678 | { |
6679 | struct mddev *mddev = disk->private_data; | 6679 | struct mddev *mddev = disk->private_data; |
6680 | 6680 | ||
6681 | BUG_ON(!mddev); | 6681 | BUG_ON(!mddev); |
6682 | atomic_dec(&mddev->openers); | 6682 | atomic_dec(&mddev->openers); |
6683 | mddev_put(mddev); | 6683 | mddev_put(mddev); |
6684 | |||
6685 | return 0; | ||
6686 | } | 6684 | } |
6687 | 6685 | ||
6688 | static int md_media_changed(struct gendisk *disk) | 6686 | static int md_media_changed(struct gendisk *disk) |
diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c index f12b78dbce04..f4176ca3a794 100644 --- a/drivers/memstick/core/mspro_block.c +++ b/drivers/memstick/core/mspro_block.c | |||
@@ -204,7 +204,7 @@ static int mspro_block_bd_open(struct block_device *bdev, fmode_t mode) | |||
204 | } | 204 | } |
205 | 205 | ||
206 | 206 | ||
207 | static int mspro_block_disk_release(struct gendisk *disk) | 207 | static void mspro_block_disk_release(struct gendisk *disk) |
208 | { | 208 | { |
209 | struct mspro_block_data *msb = disk->private_data; | 209 | struct mspro_block_data *msb = disk->private_data; |
210 | int disk_id = MINOR(disk_devt(disk)) >> MSPRO_BLOCK_PART_SHIFT; | 210 | int disk_id = MINOR(disk_devt(disk)) >> MSPRO_BLOCK_PART_SHIFT; |
@@ -224,13 +224,11 @@ static int mspro_block_disk_release(struct gendisk *disk) | |||
224 | } | 224 | } |
225 | 225 | ||
226 | mutex_unlock(&mspro_block_disk_lock); | 226 | mutex_unlock(&mspro_block_disk_lock); |
227 | |||
228 | return 0; | ||
229 | } | 227 | } |
230 | 228 | ||
231 | static int mspro_block_bd_release(struct gendisk *disk, fmode_t mode) | 229 | static void mspro_block_bd_release(struct gendisk *disk, fmode_t mode) |
232 | { | 230 | { |
233 | return mspro_block_disk_release(disk); | 231 | mspro_block_disk_release(disk); |
234 | } | 232 | } |
235 | 233 | ||
236 | static int mspro_block_bd_getgeo(struct block_device *bdev, | 234 | static int mspro_block_bd_getgeo(struct block_device *bdev, |
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c index 49e86aed2bc4..6fc3866965df 100644 --- a/drivers/message/i2o/i2o_block.c +++ b/drivers/message/i2o/i2o_block.c | |||
@@ -600,10 +600,8 @@ static int i2o_block_open(struct block_device *bdev, fmode_t mode) | |||
600 | * | 600 | * |
601 | * Unlock and unmount the media, and power down the device. Gets called if | 601 | * Unlock and unmount the media, and power down the device. Gets called if |
602 | * the block device is closed. | 602 | * the block device is closed. |
603 | * | ||
604 | * Returns 0 on success or negative error code on failure. | ||
605 | */ | 603 | */ |
606 | static int i2o_block_release(struct gendisk *disk, fmode_t mode) | 604 | static void i2o_block_release(struct gendisk *disk, fmode_t mode) |
607 | { | 605 | { |
608 | struct i2o_block_device *dev = disk->private_data; | 606 | struct i2o_block_device *dev = disk->private_data; |
609 | u8 operation; | 607 | u8 operation; |
@@ -617,7 +615,7 @@ static int i2o_block_release(struct gendisk *disk, fmode_t mode) | |||
617 | * the TID no longer exists. | 615 | * the TID no longer exists. |
618 | */ | 616 | */ |
619 | if (!dev->i2o_dev) | 617 | if (!dev->i2o_dev) |
620 | return 0; | 618 | return; |
621 | 619 | ||
622 | mutex_lock(&i2o_block_mutex); | 620 | mutex_lock(&i2o_block_mutex); |
623 | i2o_block_device_flush(dev->i2o_dev); | 621 | i2o_block_device_flush(dev->i2o_dev); |
@@ -631,8 +629,6 @@ static int i2o_block_release(struct gendisk *disk, fmode_t mode) | |||
631 | 629 | ||
632 | i2o_block_device_power(dev, operation); | 630 | i2o_block_device_power(dev, operation); |
633 | mutex_unlock(&i2o_block_mutex); | 631 | mutex_unlock(&i2o_block_mutex); |
634 | |||
635 | return 0; | ||
636 | } | 632 | } |
637 | 633 | ||
638 | static int i2o_block_getgeo(struct block_device *bdev, struct hd_geometry *geo) | 634 | static int i2o_block_getgeo(struct block_device *bdev, struct hd_geometry *geo) |
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index e12a03cc2a6e..dd27b0783d52 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -304,14 +304,13 @@ static int mmc_blk_open(struct block_device *bdev, fmode_t mode) | |||
304 | return ret; | 304 | return ret; |
305 | } | 305 | } |
306 | 306 | ||
307 | static int mmc_blk_release(struct gendisk *disk, fmode_t mode) | 307 | static void mmc_blk_release(struct gendisk *disk, fmode_t mode) |
308 | { | 308 | { |
309 | struct mmc_blk_data *md = disk->private_data; | 309 | struct mmc_blk_data *md = disk->private_data; |
310 | 310 | ||
311 | mutex_lock(&block_mutex); | 311 | mutex_lock(&block_mutex); |
312 | mmc_blk_put(md); | 312 | mmc_blk_put(md); |
313 | mutex_unlock(&block_mutex); | 313 | mutex_unlock(&block_mutex); |
314 | return 0; | ||
315 | } | 314 | } |
316 | 315 | ||
317 | static int | 316 | static int |
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 65d7e7e2fb1f..5073cbc796d8 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c | |||
@@ -237,12 +237,12 @@ error_put: | |||
237 | return ret; | 237 | return ret; |
238 | } | 238 | } |
239 | 239 | ||
240 | static int blktrans_release(struct gendisk *disk, fmode_t mode) | 240 | static void blktrans_release(struct gendisk *disk, fmode_t mode) |
241 | { | 241 | { |
242 | struct mtd_blktrans_dev *dev = blktrans_dev_get(disk); | 242 | struct mtd_blktrans_dev *dev = blktrans_dev_get(disk); |
243 | 243 | ||
244 | if (!dev) | 244 | if (!dev) |
245 | return 0; | 245 | return; |
246 | 246 | ||
247 | mutex_lock(&dev->lock); | 247 | mutex_lock(&dev->lock); |
248 | 248 | ||
@@ -260,7 +260,6 @@ static int blktrans_release(struct gendisk *disk, fmode_t mode) | |||
260 | unlock: | 260 | unlock: |
261 | mutex_unlock(&dev->lock); | 261 | mutex_unlock(&dev->lock); |
262 | blktrans_dev_put(dev); | 262 | blktrans_dev_put(dev); |
263 | return 0; | ||
264 | } | 263 | } |
265 | 264 | ||
266 | static int blktrans_getgeo(struct block_device *bdev, struct hd_geometry *geo) | 265 | static int blktrans_getgeo(struct block_device *bdev, struct hd_geometry *geo) |
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 82758cbb220b..4361d9772c42 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
@@ -2997,18 +2997,14 @@ unlock: | |||
2997 | return rc; | 2997 | return rc; |
2998 | } | 2998 | } |
2999 | 2999 | ||
3000 | static int dasd_release(struct gendisk *disk, fmode_t mode) | 3000 | static void dasd_release(struct gendisk *disk, fmode_t mode) |
3001 | { | 3001 | { |
3002 | struct dasd_device *base; | 3002 | struct dasd_device *base = dasd_device_from_gendisk(disk); |
3003 | 3003 | if (base) { | |
3004 | base = dasd_device_from_gendisk(disk); | 3004 | atomic_dec(&base->block->open_count); |
3005 | if (!base) | 3005 | module_put(base->discipline->owner); |
3006 | return -ENODEV; | 3006 | dasd_put_device(base); |
3007 | 3007 | } | |
3008 | atomic_dec(&base->block->open_count); | ||
3009 | module_put(base->discipline->owner); | ||
3010 | dasd_put_device(base); | ||
3011 | return 0; | ||
3012 | } | 3008 | } |
3013 | 3009 | ||
3014 | /* | 3010 | /* |
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index b6ad0de07930..07ba32b07fb0 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #define DCSS_BUS_ID_SIZE 20 | 26 | #define DCSS_BUS_ID_SIZE 20 |
27 | 27 | ||
28 | static int dcssblk_open(struct block_device *bdev, fmode_t mode); | 28 | static int dcssblk_open(struct block_device *bdev, fmode_t mode); |
29 | static int dcssblk_release(struct gendisk *disk, fmode_t mode); | 29 | static void dcssblk_release(struct gendisk *disk, fmode_t mode); |
30 | static void dcssblk_make_request(struct request_queue *q, struct bio *bio); | 30 | static void dcssblk_make_request(struct request_queue *q, struct bio *bio); |
31 | static int dcssblk_direct_access(struct block_device *bdev, sector_t secnum, | 31 | static int dcssblk_direct_access(struct block_device *bdev, sector_t secnum, |
32 | void **kaddr, unsigned long *pfn); | 32 | void **kaddr, unsigned long *pfn); |
@@ -781,16 +781,15 @@ out: | |||
781 | return rc; | 781 | return rc; |
782 | } | 782 | } |
783 | 783 | ||
784 | static int | 784 | static void |
785 | dcssblk_release(struct gendisk *disk, fmode_t mode) | 785 | dcssblk_release(struct gendisk *disk, fmode_t mode) |
786 | { | 786 | { |
787 | struct dcssblk_dev_info *dev_info = disk->private_data; | 787 | struct dcssblk_dev_info *dev_info = disk->private_data; |
788 | struct segment_info *entry; | 788 | struct segment_info *entry; |
789 | int rc; | ||
790 | 789 | ||
791 | if (!dev_info) { | 790 | if (!dev_info) { |
792 | rc = -ENODEV; | 791 | WARN_ON(1); |
793 | goto out; | 792 | return; |
794 | } | 793 | } |
795 | down_write(&dcssblk_devices_sem); | 794 | down_write(&dcssblk_devices_sem); |
796 | if (atomic_dec_and_test(&dev_info->use_count) | 795 | if (atomic_dec_and_test(&dev_info->use_count) |
@@ -803,9 +802,6 @@ dcssblk_release(struct gendisk *disk, fmode_t mode) | |||
803 | dev_info->save_pending = 0; | 802 | dev_info->save_pending = 0; |
804 | } | 803 | } |
805 | up_write(&dcssblk_devices_sem); | 804 | up_write(&dcssblk_devices_sem); |
806 | rc = 0; | ||
807 | out: | ||
808 | return rc; | ||
809 | } | 805 | } |
810 | 806 | ||
811 | static void | 807 | static void |
diff --git a/drivers/s390/block/scm_blk.c b/drivers/s390/block/scm_blk.c index b303cab76a7f..5d73e6e49af6 100644 --- a/drivers/s390/block/scm_blk.c +++ b/drivers/s390/block/scm_blk.c | |||
@@ -123,10 +123,9 @@ static int scm_open(struct block_device *blkdev, fmode_t mode) | |||
123 | return scm_get_ref(); | 123 | return scm_get_ref(); |
124 | } | 124 | } |
125 | 125 | ||
126 | static int scm_release(struct gendisk *gendisk, fmode_t mode) | 126 | static void scm_release(struct gendisk *gendisk, fmode_t mode) |
127 | { | 127 | { |
128 | scm_put_ref(); | 128 | scm_put_ref(); |
129 | return 0; | ||
130 | } | 129 | } |
131 | 130 | ||
132 | static const struct block_device_operations scm_blk_devops = { | 131 | static const struct block_device_operations scm_blk_devops = { |
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 7992635d405f..e6689776b4f6 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -1188,7 +1188,7 @@ error_autopm: | |||
1188 | * | 1188 | * |
1189 | * Locking: called with bdev->bd_mutex held. | 1189 | * Locking: called with bdev->bd_mutex held. |
1190 | **/ | 1190 | **/ |
1191 | static int sd_release(struct gendisk *disk, fmode_t mode) | 1191 | static void sd_release(struct gendisk *disk, fmode_t mode) |
1192 | { | 1192 | { |
1193 | struct scsi_disk *sdkp = scsi_disk(disk); | 1193 | struct scsi_disk *sdkp = scsi_disk(disk); |
1194 | struct scsi_device *sdev = sdkp->device; | 1194 | struct scsi_device *sdev = sdkp->device; |
@@ -1207,7 +1207,6 @@ static int sd_release(struct gendisk *disk, fmode_t mode) | |||
1207 | 1207 | ||
1208 | scsi_autopm_put_device(sdev); | 1208 | scsi_autopm_put_device(sdev); |
1209 | scsi_disk_put(sdkp); | 1209 | scsi_disk_put(sdkp); |
1210 | return 0; | ||
1211 | } | 1210 | } |
1212 | 1211 | ||
1213 | static int sd_getgeo(struct block_device *bdev, struct hd_geometry *geo) | 1212 | static int sd_getgeo(struct block_device *bdev, struct hd_geometry *geo) |
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index f2884ee90710..119d67f9c47e 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c | |||
@@ -541,14 +541,13 @@ static int sr_block_open(struct block_device *bdev, fmode_t mode) | |||
541 | return ret; | 541 | return ret; |
542 | } | 542 | } |
543 | 543 | ||
544 | static int sr_block_release(struct gendisk *disk, fmode_t mode) | 544 | static void sr_block_release(struct gendisk *disk, fmode_t mode) |
545 | { | 545 | { |
546 | struct scsi_cd *cd = scsi_cd(disk); | 546 | struct scsi_cd *cd = scsi_cd(disk); |
547 | mutex_lock(&sr_mutex); | 547 | mutex_lock(&sr_mutex); |
548 | cdrom_release(&cd->cdi, mode); | 548 | cdrom_release(&cd->cdi, mode); |
549 | scsi_cd_put(cd); | 549 | scsi_cd_put(cd); |
550 | mutex_unlock(&sr_mutex); | 550 | mutex_unlock(&sr_mutex); |
551 | return 0; | ||
552 | } | 551 | } |
553 | 552 | ||
554 | static int sr_block_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd, | 553 | static int sr_block_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd, |
diff --git a/fs/block_dev.c b/fs/block_dev.c index ce08de7467a3..ad2a14174ae0 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -1422,7 +1422,7 @@ static int __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part) | |||
1422 | } | 1422 | } |
1423 | if (bdev->bd_contains == bdev) { | 1423 | if (bdev->bd_contains == bdev) { |
1424 | if (disk->fops->release) | 1424 | if (disk->fops->release) |
1425 | ret = disk->fops->release(disk, mode); | 1425 | disk->fops->release(disk, mode); |
1426 | } | 1426 | } |
1427 | if (!bdev->bd_openers) { | 1427 | if (!bdev->bd_openers) { |
1428 | struct module *owner = disk->fops->owner; | 1428 | struct module *owner = disk->fops->owner; |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 78feda9bbae2..e38cfe77f7f0 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -1484,7 +1484,7 @@ static inline bool blk_integrity_is_initialized(struct gendisk *g) | |||
1484 | 1484 | ||
1485 | struct block_device_operations { | 1485 | struct block_device_operations { |
1486 | int (*open) (struct block_device *, fmode_t); | 1486 | int (*open) (struct block_device *, fmode_t); |
1487 | int (*release) (struct gendisk *, fmode_t); | 1487 | void (*release) (struct gendisk *, fmode_t); |
1488 | int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); | 1488 | int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); |
1489 | int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); | 1489 | int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); |
1490 | int (*direct_access) (struct block_device *, sector_t, | 1490 | int (*direct_access) (struct block_device *, sector_t, |