ubi: allow to read from volume with offset
Now user can pass an additional parameter 'offset' to ubi_volume_read() function. Signed-off-by: Alexey Romanov <avromanov@salutedevices.com> Reviewed-by: Heiko Schocher <hs@denx.de> Acked-by: Heiko Schocher <hs@denx.de> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
This commit is contained in:

committed by
Michael Trimarchi

parent
d12689af6c
commit
cead69c528
6
env/ubi.c
vendored
6
env/ubi.c
vendored
@@ -134,14 +134,14 @@ static int env_ubi_load(void)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
read1_fail = ubi_volume_read(CONFIG_ENV_UBI_VOLUME, (void *)tmp_env1,
|
||||
read1_fail = ubi_volume_read(CONFIG_ENV_UBI_VOLUME, (void *)tmp_env1, 0,
|
||||
CONFIG_ENV_SIZE);
|
||||
if (read1_fail)
|
||||
printf("\n** Unable to read env from %s:%s **\n",
|
||||
CONFIG_ENV_UBI_PART, CONFIG_ENV_UBI_VOLUME);
|
||||
|
||||
read2_fail = ubi_volume_read(CONFIG_ENV_UBI_VOLUME_REDUND,
|
||||
(void *)tmp_env2, CONFIG_ENV_SIZE);
|
||||
(void *)tmp_env2, 0, CONFIG_ENV_SIZE);
|
||||
if (read2_fail)
|
||||
printf("\n** Unable to read redundant env from %s:%s **\n",
|
||||
CONFIG_ENV_UBI_PART, CONFIG_ENV_UBI_VOLUME_REDUND);
|
||||
@@ -171,7 +171,7 @@ static int env_ubi_load(void)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if (ubi_volume_read(CONFIG_ENV_UBI_VOLUME, buf, CONFIG_ENV_SIZE)) {
|
||||
if (ubi_volume_read(CONFIG_ENV_UBI_VOLUME, buf, 0, CONFIG_ENV_SIZE)) {
|
||||
printf("\n** Unable to read env from %s:%s **\n",
|
||||
CONFIG_ENV_UBI_PART, CONFIG_ENV_UBI_VOLUME);
|
||||
env_set_default(NULL, 0);
|
||||
|
Reference in New Issue
Block a user