main: Retry load and flash operations only on -EAGAIN error

This commit is contained in:
Pali Rohár committed 2021-05-01 20:10:21 +02:00
1 parent 6eb58dcccb
commit 670db0d169
1 file changed
+3 -3
+3 -3
View File
@@ -1096,7 +1096,7 @@ int main(int argc, char **argv) {
if ( dev_load ) { if ( dev_load ) {
if ( image_kernel ) { if ( image_kernel ) {
ret = dev_load_image(dev, image_kernel->image); ret = dev_load_image(dev, image_kernel->image);
if ( ret < 0 ) if ( ret == -EAGAIN )
goto again; goto again;
if ( image_kernel == image_first ) if ( image_kernel == image_first )
@@ -1110,7 +1110,7 @@ int main(int argc, char **argv) {
if ( image_initfs ) { if ( image_initfs ) {
ret = dev_load_image(dev, image_initfs->image); ret = dev_load_image(dev, image_initfs->image);
if ( ret < 0 ) if ( ret == -EAGAIN )
goto again; goto again;
if ( image_initfs == image_first ) if ( image_initfs == image_first )
@@ -1129,7 +1129,7 @@ int main(int argc, char **argv) {
while ( image_ptr ) { while ( image_ptr ) {
struct image_list * next = image_ptr->next; struct image_list * next = image_ptr->next;
ret = dev_flash_image(dev, image_ptr->image); ret = dev_flash_image(dev, image_ptr->image);
if ( ret < 0 ) if ( ret == -EAGAIN )
goto again; goto again;
if ( image_ptr == image_first ) if ( image_ptr == image_first )