tools/env: complete environment device config early
authorStefan Agner <stefan.agner@toradex.com>
Thu, 14 Jul 2016 00:14:37 +0000 (17:14 -0700)
committerTom Rini <trini@konsulko.com>
Fri, 22 Jul 2016 18:46:20 +0000 (14:46 -0400)
commit14fb5b252ac21c81e24fa734c3f66e9d6c3a0932
treec77092d5e57b6ccb2b7f05acb563b57abd96bae9
parent28f0014bde9993354223ed250df22ba97d381565
tools/env: complete environment device config early

Currently flash_read completes a crucial part of the environment
device configuration, the device type (mtd_type). This is rather
confusing as flash_io calls flash_read conditionally, and one might
think flash_write, which also makes use of mtd_type, gets called
before flash_read. But since flash_io is always called with O_RDONLY
first, this is not actually the case in reality.

However, it is much cleaner to complete and verify the config early
in parse_config. This also prepares the code for further extension.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Reviewed-by: Andreas Fenkart
tools/env/fw_env.c