Remove some code duplication
authorUwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Mon, 20 Jun 2011 12:50:16 +0000 (14:50 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 21 Jun 2011 07:48:27 +0000 (09:48 +0200)
examples/eeprom.c

index e2c8052..8d74d2c 100644 (file)
@@ -177,23 +177,13 @@ int main(int argc, char **argv)
                     f, ftdi_get_error_string(ftdi));
             exit(-1);
         }
-        f = ftdi_read_eeprom(ftdi);
-        if (f < 0)
-        {
-            fprintf(stderr, "ftdi_read_eeprom: %d (%s)\n",
-                    f, ftdi_get_error_string(ftdi));
-            exit(-1);
-        }
     }
-    else
+    f = ftdi_read_eeprom(ftdi);
+    if (f < 0)
     {
-        f = ftdi_read_eeprom(ftdi);
-        if (f < 0)
-        {
-            fprintf(stderr, "ftdi_read_eeprom: %d (%s)\n",
-                    f, ftdi_get_error_string(ftdi));
-            exit(-1);
-        }
+        fprintf(stderr, "ftdi_read_eeprom: %d (%s)\n",
+                f, ftdi_get_error_string(ftdi));
+        exit(-1);
     }