aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/um/drivers/ubd_kern.c5
-rw-r--r--arch/xtensa/platforms/iss/simdisk.c3
-rw-r--r--drivers/block/amiflop.c3
-rw-r--r--drivers/block/aoe/aoeblk.c6
-rw-r--r--drivers/block/ataflop.c5
-rw-r--r--drivers/block/cciss.c5
-rw-r--r--drivers/block/cpqarray.c6
-rw-r--r--drivers/block/drbd/drbd_main.c5
-rw-r--r--drivers/block/floppy.c4
-rw-r--r--drivers/block/loop.c6
-rw-r--r--drivers/block/paride/pcd.c3
-rw-r--r--drivers/block/paride/pd.c4
-rw-r--r--drivers/block/paride/pf.c9
-rw-r--r--drivers/block/pktcdvd.c4
-rw-r--r--drivers/block/rbd.c4
-rw-r--r--drivers/block/swim.c4
-rw-r--r--drivers/block/swim3.c5
-rw-r--r--drivers/block/xen-blkfront.c3
-rw-r--r--drivers/block/xsysace.c3
-rw-r--r--drivers/block/z2ram.c6
-rw-r--r--drivers/cdrom/gdrom.c3
-rw-r--r--drivers/ide/ide-cd.c4
-rw-r--r--drivers/ide/ide-gd.c4
-rw-r--r--drivers/ide/ide-tape.c4
-rw-r--r--drivers/md/dm.c4
-rw-r--r--drivers/md/md.c4
-rw-r--r--drivers/memstick/core/mspro_block.c8
-rw-r--r--drivers/message/i2o/i2o_block.c8
-rw-r--r--drivers/mmc/card/block.c3
-rw-r--r--drivers/mtd/mtd_blkdevs.c5
-rw-r--r--drivers/s390/block/dasd.c18
-rw-r--r--drivers/s390/block/dcssblk.c12
-rw-r--r--drivers/s390/block/scm_blk.c3
-rw-r--r--drivers/scsi/sd.c3
-rw-r--r--drivers/scsi/sr.c3
-rw-r--r--fs/block_dev.c2
-rw-r--r--include/linux/blkdev.h2
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);
87static DEFINE_MUTEX(ubd_mutex); /* replaces BKL, might not be needed */ 87static DEFINE_MUTEX(ubd_mutex); /* replaces BKL, might not be needed */
88 88
89static int ubd_open(struct block_device *bdev, fmode_t mode); 89static int ubd_open(struct block_device *bdev, fmode_t mode);
90static int ubd_release(struct gendisk *disk, fmode_t mode); 90static void ubd_release(struct gendisk *disk, fmode_t mode);
91static int ubd_ioctl(struct block_device *bdev, fmode_t mode, 91static int ubd_ioctl(struct block_device *bdev, fmode_t mode,
92 unsigned int cmd, unsigned long arg); 92 unsigned int cmd, unsigned long arg);
93static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo); 93static 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
1141static int ubd_release(struct gendisk *disk, fmode_t mode) 1141static 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
1152static void cowify_bitmap(__u64 io_offset, int length, unsigned long *cow_mask, 1151static 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
142static int simdisk_release(struct gendisk *disk, fmode_t mode) 142static 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
151static const struct block_device_operations simdisk_ops = { 150static 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
1637static int floppy_release(struct gendisk *disk, fmode_t mode) 1637static 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
172static int 172static void
173aoeblk_release(struct gendisk *disk, fmode_t mode) 173aoeblk_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
190static void 188static 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 );
367static int fd_test_drive_present( int drive ); 367static int fd_test_drive_present( int drive );
368static void config_types( void ); 368static void config_types( void );
369static int floppy_open(struct block_device *bdev, fmode_t mode); 369static int floppy_open(struct block_device *bdev, fmode_t mode);
370static int floppy_release(struct gendisk *disk, fmode_t mode); 370static 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
1889static int floppy_release(struct gendisk *disk, fmode_t mode) 1889static 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
1903static const struct block_device_operations floppy_fops = { 1902static 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);
161static irqreturn_t do_cciss_msix_intr(int irq, void *dev_id); 161static irqreturn_t do_cciss_msix_intr(int irq, void *dev_id);
162static int cciss_open(struct block_device *bdev, fmode_t mode); 162static int cciss_open(struct block_device *bdev, fmode_t mode);
163static int cciss_unlocked_open(struct block_device *bdev, fmode_t mode); 163static int cciss_unlocked_open(struct block_device *bdev, fmode_t mode);
164static int cciss_release(struct gendisk *disk, fmode_t mode); 164static void cciss_release(struct gendisk *disk, fmode_t mode);
165static int do_ioctl(struct block_device *bdev, fmode_t mode, 165static int do_ioctl(struct block_device *bdev, fmode_t mode,
166 unsigned int cmd, unsigned long arg); 166 unsigned int cmd, unsigned long arg);
167static int cciss_ioctl(struct block_device *bdev, fmode_t mode, 167static 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 */
1126static int cciss_release(struct gendisk *disk, fmode_t mode) 1126static 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
1141static int do_ioctl(struct block_device *bdev, fmode_t mode, 1140static 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
162static int ida_unlocked_open(struct block_device *bdev, fmode_t mode); 162static int ida_unlocked_open(struct block_device *bdev, fmode_t mode);
163static int ida_release(struct gendisk *disk, fmode_t mode); 163static void ida_release(struct gendisk *disk, fmode_t mode);
164static int ida_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg); 164static int ida_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg);
165static int ida_getgeo(struct block_device *bdev, struct hd_geometry *geo); 165static int ida_getgeo(struct block_device *bdev, struct hd_geometry *geo);
166static int ida_ctlr_ioctl(ctlr_info_t *h, int dsk, ida_ioctl_t *io); 166static 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 */
859static int ida_release(struct gendisk *disk, fmode_t mode) 859static 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
64int drbd_init(void); 64int drbd_init(void);
65static int drbd_open(struct block_device *bdev, fmode_t mode); 65static int drbd_open(struct block_device *bdev, fmode_t mode);
66static int drbd_release(struct gendisk *gd, fmode_t mode); 66static void drbd_release(struct gendisk *gd, fmode_t mode);
67static int w_md_sync(struct drbd_work *w, int unused); 67static int w_md_sync(struct drbd_work *w, int unused);
68static void md_sync_timer_fn(unsigned long data); 68static void md_sync_timer_fn(unsigned long data);
69static int w_bitmap_io(struct drbd_work *w, int unused); 69static 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
1852static int drbd_release(struct gendisk *gd, fmode_t mode) 1852static 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
1861static void drbd_set_defaults(struct drbd_conf *mdev) 1860static 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
3604static int floppy_release(struct gendisk *disk, fmode_t mode) 3604static 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
1521static int lo_release(struct gendisk *disk, fmode_t mode) 1521static 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
1547out: 1547out:
1548 mutex_unlock(&lo->lo_ctl_mutex); 1548 mutex_unlock(&lo->lo_ctl_mutex);
1549out_unlocked:
1550 return 0;
1551} 1549}
1552 1550
1553static const struct block_device_operations lo_fops = { 1551static 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
239static int pcd_block_release(struct gendisk *disk, fmode_t mode) 239static 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
248static int pcd_block_ioctl(struct block_device *bdev, fmode_t mode, 247static 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
786static int pd_release(struct gendisk *p, fmode_t mode) 786static 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
798static unsigned int pd_check_events(struct gendisk *p, unsigned int clearing) 796static 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);
212static int pf_getgeo(struct block_device *bdev, struct hd_geometry *geo); 212static int pf_getgeo(struct block_device *bdev, struct hd_geometry *geo);
213 213
214static int pf_release(struct gendisk *disk, fmode_t mode); 214static void pf_release(struct gendisk *disk, fmode_t mode);
215 215
216static int pf_detect(void); 216static int pf_detect(void);
217static void do_pf_read(void); 217static 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
363static int pf_release(struct gendisk *disk, fmode_t mode) 363static 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
383static unsigned int pf_check_events(struct gendisk *disk, unsigned int clearing) 382static 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
2379static int pkt_close(struct gendisk *disk, fmode_t mode) 2379static 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
414static int rbd_release(struct gendisk *disk, fmode_t mode) 414static 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
431static const struct block_device_operations rbd_bd_ops = { 429static 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
676static int floppy_release(struct gendisk *disk, fmode_t mode) 676static 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
694static int floppy_ioctl(struct block_device *bdev, fmode_t mode, 692static 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);
251static int floppy_ioctl(struct block_device *bdev, fmode_t mode, 251static int floppy_ioctl(struct block_device *bdev, fmode_t mode,
252 unsigned int cmd, unsigned long param); 252 unsigned int cmd, unsigned long param);
253static int floppy_open(struct block_device *bdev, fmode_t mode); 253static int floppy_open(struct block_device *bdev, fmode_t mode);
254static int floppy_release(struct gendisk *disk, fmode_t mode); 254static void floppy_release(struct gendisk *disk, fmode_t mode);
255static unsigned int floppy_check_events(struct gendisk *disk, 255static unsigned int floppy_check_events(struct gendisk *disk,
256 unsigned int clearing); 256 unsigned int clearing);
257static int floppy_revalidate(struct gendisk *disk); 257static 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
1020static int floppy_release(struct gendisk *disk, fmode_t mode) 1020static 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
1035static unsigned int floppy_check_events(struct gendisk *disk, 1034static 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
1620static int blkif_release(struct gendisk *disk, fmode_t mode) 1620static 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)
1658out: 1658out:
1659 bdput(bdev); 1659 bdput(bdev);
1660 mutex_unlock(&blkfront_mutex); 1660 mutex_unlock(&blkfront_mutex);
1661 return 0;
1662} 1661}
1663 1662
1664static const struct block_device_operations xlvbd_block_fops = 1663static 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
918static int ace_release(struct gendisk *disk, fmode_t mode) 918static 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
938static int ace_getgeo(struct block_device *bdev, struct hd_geometry *geo) 937static 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
312static int 312static void
313z2_release(struct gendisk *disk, fmode_t mode) 313z2_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
328static const struct block_device_operations z2_fops = 326static 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
506static int gdrom_bdops_release(struct gendisk *disk, fmode_t mode) 506static 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
514static unsigned int gdrom_bdops_check_events(struct gendisk *disk, 513static 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
1609static int idecd_release(struct gendisk *disk, fmode_t mode) 1609static 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
1622static int idecd_set_spindown(struct cdrom_device_info *cdi, unsigned long arg) 1620static 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
253static int ide_gd_release(struct gendisk *disk, fmode_t mode) 253static 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
277static int ide_gd_getgeo(struct block_device *bdev, struct hd_geometry *geo) 275static 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
1921static int idetape_release(struct gendisk *disk, fmode_t mode) 1921static 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
1932static int idetape_ioctl(struct block_device *bdev, fmode_t mode, 1930static 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
342static int dm_blk_close(struct gendisk *disk, fmode_t mode) 342static 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
356int dm_open_count(struct mapped_device *md) 354int 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
6677static int md_release(struct gendisk *disk, fmode_t mode) 6677static 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
6688static int md_media_changed(struct gendisk *disk) 6686static 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
207static int mspro_block_disk_release(struct gendisk *disk) 207static 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
231static int mspro_block_bd_release(struct gendisk *disk, fmode_t mode) 229static 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
236static int mspro_block_bd_getgeo(struct block_device *bdev, 234static 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 */
606static int i2o_block_release(struct gendisk *disk, fmode_t mode) 604static 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
638static int i2o_block_getgeo(struct block_device *bdev, struct hd_geometry *geo) 634static 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
307static int mmc_blk_release(struct gendisk *disk, fmode_t mode) 307static 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
317static int 316static 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
240static int blktrans_release(struct gendisk *disk, fmode_t mode) 240static 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)
260unlock: 260unlock:
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
266static int blktrans_getgeo(struct block_device *bdev, struct hd_geometry *geo) 265static 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
3000static int dasd_release(struct gendisk *disk, fmode_t mode) 3000static 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
28static int dcssblk_open(struct block_device *bdev, fmode_t mode); 28static int dcssblk_open(struct block_device *bdev, fmode_t mode);
29static int dcssblk_release(struct gendisk *disk, fmode_t mode); 29static void dcssblk_release(struct gendisk *disk, fmode_t mode);
30static void dcssblk_make_request(struct request_queue *q, struct bio *bio); 30static void dcssblk_make_request(struct request_queue *q, struct bio *bio);
31static int dcssblk_direct_access(struct block_device *bdev, sector_t secnum, 31static 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
784static int 784static void
785dcssblk_release(struct gendisk *disk, fmode_t mode) 785dcssblk_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;
807out:
808 return rc;
809} 805}
810 806
811static void 807static 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
126static int scm_release(struct gendisk *gendisk, fmode_t mode) 126static 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
132static const struct block_device_operations scm_blk_devops = { 131static 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 **/
1191static int sd_release(struct gendisk *disk, fmode_t mode) 1191static 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
1213static int sd_getgeo(struct block_device *bdev, struct hd_geometry *geo) 1212static 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
544static int sr_block_release(struct gendisk *disk, fmode_t mode) 544static 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
554static int sr_block_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd, 553static 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
1485struct block_device_operations { 1485struct 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,