aboutsummaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2015-12-07 11:38:48 -0700
committerTom Rini <trini@konsulko.com>2016-01-13 21:05:18 -0500
commit7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86 (patch)
tree8dfb6b9f5721891de191bad798b0533e3a0bf69a /drivers/block
parentadc421e4cee8275cd99367b3b455ffbb5ead3990 (diff)
downloadu-boot-7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86.zip
u-boot-7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86.tar.gz
u-boot-7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86.tar.bz2
block: pass block dev not num to read/write/erase()
This will allow the implementation to make use of data in the block_dev structure beyond the base device number. This will be useful so that eMMC block devices can encompass the HW partition ID rather than treating this out-of-band. Equally, the existence of the priv field is crying out for this patch to exist. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/sandbox.c12
-rw-r--r--drivers/block/systemace.c10
2 files changed, 14 insertions, 8 deletions
diff --git a/drivers/block/sandbox.c b/drivers/block/sandbox.c
index 73f4c4a..170f0fa 100644
--- a/drivers/block/sandbox.c
+++ b/drivers/block/sandbox.c
@@ -22,9 +22,11 @@ static struct host_block_dev *find_host_device(int dev)
return NULL;
}
-static unsigned long host_block_read(int dev, unsigned long start,
- lbaint_t blkcnt, void *buffer)
+static unsigned long host_block_read(block_dev_desc_t *block_dev,
+ unsigned long start, lbaint_t blkcnt,
+ void *buffer)
{
+ int dev = block_dev->dev;
struct host_block_dev *host_dev = find_host_device(dev);
if (!host_dev)
@@ -42,9 +44,11 @@ static unsigned long host_block_read(int dev, unsigned long start,
return -1;
}
-static unsigned long host_block_write(int dev, unsigned long start,
- lbaint_t blkcnt, const void *buffer)
+static unsigned long host_block_write(block_dev_desc_t *block_dev,
+ unsigned long start, lbaint_t blkcnt,
+ const void *buffer)
{
+ int dev = block_dev->dev;
struct host_block_dev *host_dev = find_host_device(dev);
if (os_lseek(host_dev->fd,
start * host_dev->blk_dev.blksz,
diff --git a/drivers/block/systemace.c b/drivers/block/systemace.c
index fdf75b5..b974e80 100644
--- a/drivers/block/systemace.c
+++ b/drivers/block/systemace.c
@@ -69,8 +69,9 @@ static u16 ace_readw(unsigned off)
return in16(base + off);
}
-static unsigned long systemace_read(int dev, unsigned long start,
- lbaint_t blkcnt, void *buffer);
+static unsigned long systemace_read(block_dev_desc_t *block_dev,
+ unsigned long start, lbaint_t blkcnt,
+ void *buffer);
static block_dev_desc_t systemace_dev = { 0 };
@@ -136,8 +137,9 @@ block_dev_desc_t *systemace_get_dev(int dev)
* the dev_desc) to read blocks of data. The return value is the
* number of blocks read. A zero return indicates an error.
*/
-static unsigned long systemace_read(int dev, unsigned long start,
- lbaint_t blkcnt, void *buffer)
+static unsigned long systemace_read(block_dev_desc_t *block_dev,
+ unsigned long start, lbaint_t blkcnt,
+ void *buffer)
{
int retry;
unsigned blk_countdown;