mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-02-23 12:40:43 +01:00
onenand_spl_simple: Call onenand_spl_get_geometry() only once
Do not call onenand_spl_get_geometry() for each block read. Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
This commit is contained in:
parent
6d7a570764
commit
0da008ef8d
1 changed files with 5 additions and 2 deletions
|
|
@ -110,9 +110,12 @@ static u8 scratch_buf[PAGE_4K];
|
|||
*/
|
||||
int onenand_spl_read_block(int block, int offset, int len, void *dst)
|
||||
{
|
||||
int page, read, psize;
|
||||
int page, read;
|
||||
static int psize;
|
||||
|
||||
if (!psize)
|
||||
psize = onenand_spl_get_geometry();
|
||||
|
||||
psize = onenand_spl_get_geometry();
|
||||
/* Calculate the page number */
|
||||
page = offset / psize;
|
||||
/* Offset to the start of a flash page */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue