summaryrefslogtreecommitdiffstats
path: root/common/block.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-07-04 09:07:24 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-07-14 08:01:11 +0200
commit2d9d230089d0a5088bb3b37b01dfddc6527740a6 (patch)
treeda90322653fc20a9de4b1ebf5650189ee2f20648 /common/block.c
parent2e82822d080950d9f2cc2bfadafd31ec9809b871 (diff)
downloadbarebox-2d9d230089d0a5088bb3b37b01dfddc6527740a6.tar.gz
block: Add flush callback
Some block devices need an explicit callback for flushing written blocks. Add this callback. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/block.c')
-rw-r--r--common/block.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/block.c b/common/block.c
index e522ee4..0edc861 100644
--- a/common/block.c
+++ b/common/block.c
@@ -55,6 +55,9 @@ static int writebuffer_flush(struct block_device *blk)
}
}
+ if (blk->ops->flush)
+ return blk->ops->flush(blk);
+
return 0;
}