diff options
author | Simon Glass <sjg@chromium.org> | 2016-02-29 15:25:52 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-03-14 15:34:50 -0600 |
commit | 2a981dc2c62c500110aad297fa70503aec36e689 (patch) | |
tree | a2098718e857b136986ee0401a40037b16e51a3a /disk/part_mac.c | |
parent | bcce53d048de7f41078d25e39aa2f26d752d3658 (diff) | |
download | u-boot-2a981dc2c62c500110aad297fa70503aec36e689.zip u-boot-2a981dc2c62c500110aad297fa70503aec36e689.tar.gz u-boot-2a981dc2c62c500110aad297fa70503aec36e689.tar.bz2 |
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 'disk/part_mac.c')
-rw-r--r-- | disk/part_mac.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/disk/part_mac.c b/disk/part_mac.c index 07bbc19..ce57b57 100644 --- a/disk/part_mac.c +++ b/disk/part_mac.c @@ -53,8 +53,7 @@ static int test_part_mac(struct blk_desc *dev_desc) n = 1; /* assuming at least one partition */ for (i=1; i<=n; ++i) { - if ((dev_desc->block_read(dev_desc, i, 1, - (ulong *)mpart) != 1) || + if ((blk_dread(dev_desc, i, 1, (ulong *)mpart) != 1) || (mpart->signature != MAC_PARTITION_MAGIC) ) { return (-1); } @@ -106,7 +105,7 @@ static void print_part_mac(struct blk_desc *dev_desc) char c; printf ("%4ld: ", i); - if (dev_desc->block_read(dev_desc, i, 1, (ulong *)mpart) != 1) { + if (blk_dread(dev_desc, i, 1, (ulong *)mpart) != 1) { printf ("** Can't read Partition Map on %d:%ld **\n", dev_desc->devnum, i); return; @@ -153,7 +152,7 @@ static void print_part_mac(struct blk_desc *dev_desc) static int part_mac_read_ddb(struct blk_desc *dev_desc, mac_driver_desc_t *ddb_p) { - if (dev_desc->block_read(dev_desc, 0, 1, (ulong *)ddb_p) != 1) { + if (blk_dread(dev_desc, 0, 1, (ulong *)ddb_p) != 1) { printf ("** Can't read Driver Desriptor Block **\n"); return (-1); } @@ -182,7 +181,7 @@ static int part_mac_read_pdb(struct blk_desc *dev_desc, int part, * partition 1 first since this is the only way to * know how many partitions we have. */ - if (dev_desc->block_read(dev_desc, n, 1, (ulong *)pdb_p) != 1) { + if (blk_dread(dev_desc, n, 1, (ulong *)pdb_p) != 1) { printf ("** Can't read Partition Map on %d:%d **\n", dev_desc->devnum, n); return (-1); |