summaryrefslogtreecommitdiffstats
path: root/common/block.c
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2019-01-11 21:58:14 -0800
committerSascha Hauer <s.hauer@pengutronix.de>2019-01-18 09:43:27 +0100
commit9102efae6ab7d8ee2607b842f2cdf6cbffaadb86 (patch)
tree33c5010ab647e7f9838df61749d6aebf2a030272 /common/block.c
parent51b307f6ec4c1cdb53771ef016f93aeef8831e97 (diff)
downloadbarebox-9102efae6ab7d8ee2607b842f2cdf6cbffaadb86.tar.gz
barebox-9102efae6ab7d8ee2607b842f2cdf6cbffaadb86.tar.xz
block: Alias block_op_close() to block_op_flush()
The two functions are identical, so there's no need to keep two copies of the same code around. Alias block_op_close() to block_op_flush() and drop standalone definition for the former. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/block.c')
-rw-r--r--common/block.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/common/block.c b/common/block.c
index 8d0de42d90..549df71a9d 100644
--- a/common/block.c
+++ b/common/block.c
@@ -329,13 +329,6 @@ static ssize_t block_op_write(struct cdev *cdev, const void *buf, size_t count,
}
#endif
-static int block_op_close(struct cdev *cdev)
-{
- struct block_device *blk = cdev->priv;
-
- return writebuffer_flush(blk);
-}
-
static int block_op_flush(struct cdev *cdev)
{
struct block_device *blk = cdev->priv;
@@ -343,6 +336,8 @@ static int block_op_flush(struct cdev *cdev)
return writebuffer_flush(blk);
}
+static int block_op_close(struct cdev *cdev) __alias(block_op_flush);
+
static struct cdev_operations block_ops = {
.read = block_op_read,
#ifdef CONFIG_BLOCK_WRITE