aboutsummaryrefslogtreecommitdiff
path: root/fs/fat
diff options
context:
space:
mode:
authorSimon Glass2016-02-29 15:25:52 -0700
committerSimon Glass2016-03-14 15:34:50 -0600
commit2a981dc2c62c500110aad297fa70503aec36e689 (patch)
treea2098718e857b136986ee0401a40037b16e51a3a /fs/fat
parentbcce53d048de7f41078d25e39aa2f26d752d3658 (diff)
dm: block: Adjust device calls to go through helpers function
To ease conversion to driver model, add helper functions which deal with calling each block device method. With driver model we can reimplement these functions with the same arguments. Use inline functions to avoid increasing code size on some boards. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'fs/fat')
-rw-r--r--fs/fat/fat.c6
-rw-r--r--fs/fat/fat_write.c5
2 files changed, 5 insertions, 6 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index f87ddd7630c..600a90e3092 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -10,6 +10,7 @@
*/
#include <common.h>
+#include <blk.h>
#include <config.h>
#include <exports.h>
#include <fat.h>
@@ -48,11 +49,10 @@ static int disk_read(__u32 block, __u32 nr_blocks, void *buf)
{
ulong ret;
- if (!cur_dev || !cur_dev->block_read)
+ if (!cur_dev)
return -1;
- ret = cur_dev->block_read(cur_dev, cur_part_info.start + block,
- nr_blocks, buf);
+ ret = blk_dread(cur_dev, cur_part_info.start + block, nr_blocks, buf);
if (nr_blocks && ret == 0)
return -1;
diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
index 5ed324ce1a0..baa85ec3b44 100644
--- a/fs/fat/fat_write.c
+++ b/fs/fat/fat_write.c
@@ -32,7 +32,7 @@ static int disk_write(__u32 block, __u32 nr_blocks, void *buf)
{
ulong ret;
- if (!cur_dev || !cur_dev->block_write)
+ if (!cur_dev)
return -1;
if (cur_part_info.start + block + nr_blocks >
@@ -41,8 +41,7 @@ static int disk_write(__u32 block, __u32 nr_blocks, void *buf)
return -1;
}
- ret = cur_dev->block_write(cur_dev, cur_part_info.start + block,
- nr_blocks, buf);
+ ret = blk_dwrite(cur_dev, cur_part_info.start + block, nr_blocks, buf);
if (nr_blocks && ret == 0)
return -1;