diff options
author | Stephen Warren <swarren@nvidia.com> | 2015-12-07 11:38:48 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-01-13 21:05:18 -0500 |
commit | 7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86 (patch) | |
tree | 8dfb6b9f5721891de191bad798b0533e3a0bf69a /common/usb_storage.c | |
parent | adc421e4cee8275cd99367b3b455ffbb5ead3990 (diff) | |
download | u-boot-7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86.tar.gz |
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 'common/usb_storage.c')
-rw-r--r-- | common/usb_storage.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/common/usb_storage.c b/common/usb_storage.c index e61a8c8adf..4fdb55f9fa 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -119,10 +119,10 @@ int usb_stor_get_info(struct usb_device *dev, struct us_data *us, block_dev_desc_t *dev_desc); int usb_storage_probe(struct usb_device *dev, unsigned int ifnum, struct us_data *ss); -unsigned long usb_stor_read(int device, lbaint_t blknr, - lbaint_t blkcnt, void *buffer); -unsigned long usb_stor_write(int device, lbaint_t blknr, - lbaint_t blkcnt, const void *buffer); +static unsigned long usb_stor_read(block_dev_desc_t *block_dev, lbaint_t blknr, + lbaint_t blkcnt, void *buffer); +static unsigned long usb_stor_write(block_dev_desc_t *block_dev, lbaint_t blknr, + lbaint_t blkcnt, const void *buffer); void uhci_show_temp_int_td(void); #ifdef CONFIG_PARTITIONS @@ -1027,9 +1027,10 @@ static void usb_bin_fixup(struct usb_device_descriptor descriptor, } #endif /* CONFIG_USB_BIN_FIXUP */ -unsigned long usb_stor_read(int device, lbaint_t blknr, - lbaint_t blkcnt, void *buffer) +static unsigned long usb_stor_read(block_dev_desc_t *block_dev, lbaint_t blknr, + lbaint_t blkcnt, void *buffer) { + int device = block_dev->dev; lbaint_t start, blks; uintptr_t buf_addr; unsigned short smallblks; @@ -1097,9 +1098,10 @@ retry_it: return blkcnt; } -unsigned long usb_stor_write(int device, lbaint_t blknr, - lbaint_t blkcnt, const void *buffer) +static unsigned long usb_stor_write(block_dev_desc_t *block_dev, lbaint_t blknr, + lbaint_t blkcnt, const void *buffer) { + int device = block_dev->dev; lbaint_t start, blks; uintptr_t buf_addr; unsigned short smallblks; |