From a8ca889ed9585894d53fd8919d80cbe8baff09e7 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 5 May 2013 21:31:22 -0400 Subject: [PATCH] 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 --- drivers/mtd/mtd_blkdevs.c | 8 ++++---- drivers/mtd/mtdblock.c | 4 +--- drivers/mtd/sm_ftl.c | 3 +-- include/linux/mtd/blktrans.h | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 5ad39bb5ab4c..65d7e7e2fb1f 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c @@ -240,10 +240,9 @@ error_put: 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) diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c index 6c6d80736fad..2aef5dda522b 100644 --- a/drivers/mtd/mtdblock.c +++ b/drivers/mtd/mtdblock.c @@ -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) diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c index 8dd6ba52404a..f9d5615c5727 100644 --- a/drivers/mtd/sm_ftl.c +++ b/drivers/mtd/sm_ftl.c @@ -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 */ diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h index 4eb0a50d0c55..e93837f647de 100644 --- a/include/linux/mtd/blktrans.h +++ b/include/linux/mtd/blktrans.h @@ -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. */