state: Fix lseek error check in state_mtd_peb_read()
This ports the following barebox commit:
| commit 8a6a9fb
| Author: Andrey Smirnov <andrew.smirnov@gmail.com>
| Date: Wed Mar 6 23:49:23 2019 -0800
|
| state: Fix lseek error check in state_mtd_peb_read()
|
| Don't use 'int' to store lseek()'s return value to avoid problems with
| large seek offsets. While at it, make sure to populate return error
| code from 'errno'.
|
| Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
| Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>