summaryrefslogtreecommitdiff
path: root/include/blk.h
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2017-06-09 16:45:18 +0200
committerSimon Glass <sjg@chromium.org>2017-09-11 21:43:58 -0600
commit5fe7702eccf1bae5b10f0309cef03e02bfdfa6ef (patch)
tree1c32f209698ac10b795e3a61f0977cf65da1aee7 /include/blk.h
parentc98ac3487e413c71e5d36322ef3324b21c6f60f9 (diff)
blk: dm: make blk_create_device() take a number of block instead of a size
There is an overflow problem when taking the size instead of the number of blocks in blk_create_device(). This results in a wrong device size: the device apparent size is its real size modulo 4GB. Using the number of blocks instead of the device size fixes the problem and is more coherent with the internals of the block layer. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/blk.h')
-rw-r--r--include/blk.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/blk.h b/include/blk.h
index 27abfddb94..1965812a9d 100644
--- a/include/blk.h
+++ b/include/blk.h
@@ -315,12 +315,12 @@ int blk_next_device(struct udevice **devp);
* @devnum: Device number, specific to the interface type, or -1 to
* allocate the next available number
* @blksz: Block size of the device in bytes (typically 512)
- * @size: Total size of the device in bytes
+ * @lba: Total number of blocks of the device
* @devp: the new device (which has not been probed)
*/
int blk_create_device(struct udevice *parent, const char *drv_name,
const char *name, int if_type, int devnum, int blksz,
- lbaint_t size, struct udevice **devp);
+ lbaint_t lba, struct udevice **devp);
/**
* blk_create_devicef() - Create a new named block device
@@ -332,12 +332,12 @@ int blk_create_device(struct udevice *parent, const char *drv_name,
* @devnum: Device number, specific to the interface type, or -1 to
* allocate the next available number
* @blksz: Block size of the device in bytes (typically 512)
- * @size: Total size of the device in bytes
+ * @lba: Total number of blocks of the device
* @devp: the new device (which has not been probed)
*/
int blk_create_devicef(struct udevice *parent, const char *drv_name,
const char *name, int if_type, int devnum, int blksz,
- lbaint_t size, struct udevice **devp);
+ lbaint_t lba, struct udevice **devp);
/**
* blk_prepare_device() - Prepare a block device for use