mtd_blktrans_ops->release() should return void

Both existing instances always return 0 and even if they didn't,
the value would be lost on the way out.  Just don't bother...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2013-05-05 21:31:22 -04:00
parent 1950267e6e
commit a8ca889ed9
4 changed files with 7 additions and 10 deletions

View File

@ -240,10 +240,9 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode)
static int blktrans_release(struct gendisk *disk, fmode_t mode)
{
struct mtd_blktrans_dev *dev = blktrans_dev_get(disk);
int ret = 0;
if (!dev)
return ret;
return 0;
mutex_lock(&dev->lock);
@ -254,13 +253,14 @@ static int blktrans_release(struct gendisk *disk, fmode_t mode)
module_put(dev->tr->owner);
if (dev->mtd) {
ret = dev->tr->release ? dev->tr->release(dev) : 0;
if (dev->tr->release)
dev->tr->release(dev);
__put_mtd_device(dev->mtd);
}
unlock:
mutex_unlock(&dev->lock);
blktrans_dev_put(dev);
return ret;
return 0;
}
static int blktrans_getgeo(struct block_device *bdev, struct hd_geometry *geo)

View File

@ -308,7 +308,7 @@ static int mtdblock_open(struct mtd_blktrans_dev *mbd)
return 0;
}
static int mtdblock_release(struct mtd_blktrans_dev *mbd)
static void mtdblock_release(struct mtd_blktrans_dev *mbd)
{
struct mtdblk_dev *mtdblk = container_of(mbd, struct mtdblk_dev, mbd);
@ -333,8 +333,6 @@ static int mtdblock_release(struct mtd_blktrans_dev *mbd)
mutex_unlock(&mtdblks_lock);
pr_debug("ok\n");
return 0;
}
static int mtdblock_flush(struct mtd_blktrans_dev *dev)

View File

@ -1107,7 +1107,7 @@ static int sm_flush(struct mtd_blktrans_dev *dev)
}
/* outside interface: device is released */
static int sm_release(struct mtd_blktrans_dev *dev)
static void sm_release(struct mtd_blktrans_dev *dev)
{
struct sm_ftl *ftl = dev->priv;
@ -1116,7 +1116,6 @@ static int sm_release(struct mtd_blktrans_dev *dev)
cancel_work_sync(&ftl->flush_work);
sm_cache_flush(ftl);
mutex_unlock(&ftl->mutex);
return 0;
}
/* outside interface: get geometry */

View File

@ -74,7 +74,7 @@ struct mtd_blktrans_ops {
/* Called with mtd_table_mutex held; no race with add/remove */
int (*open)(struct mtd_blktrans_dev *dev);
int (*release)(struct mtd_blktrans_dev *dev);
void (*release)(struct mtd_blktrans_dev *dev);
/* Called on {de,}registration and on subsequent addition/removal
of devices, with mtd_table_mutex held. */