]> git.baikalelectronics.ru Git - uboot.git/commit
blk: dm: make blk_create_device() take a number of block instead of a size
authorJean-Jacques Hiblot <jjhiblot@ti.com>
Fri, 9 Jun 2017 14:45:18 +0000 (16:45 +0200)
committerSimon Glass <sjg@chromium.org>
Tue, 12 Sep 2017 03:43:58 +0000 (21:43 -0600)
commit3b2f071285b4437891e0c12679e7da02effbc831
tree1c32f209698ac10b795e3a61f0977cf65da1aee7
parent167160ac26d61a2c9a5076d2c8c41d5e265f84f2
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>
drivers/block/blk-uclass.c
drivers/block/sandbox.c
drivers/scsi/scsi.c
include/blk.h
test/dm/blk.c