carl9170 firmware: fix error code handling
authorChristian Lamparter <chunkeey@googlemail.com>
Tue, 10 Aug 2010 23:02:21 +0000 (01:02 +0200)
committerChristian Lamparter <chunkeey@googlemail.com>
Tue, 10 Aug 2010 23:02:21 +0000 (01:02 +0200)
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
tools/src/checksum.c
tools/src/eeprom_fix.c
tools/src/fwinfo.c

index 7d1ae35dac906eeb33e2a0e0282185c8e13361dd..24f70367bb8e328bd2a2615dcb5141bc337e2165 100644 (file)
@@ -54,8 +54,9 @@ int main(int argc, char *args[])
 
        fw = carlfw_load(args[1]);
        if (IS_ERR_OR_NULL(fw)) {
+               err = PTR_ERR(fw);
                fprintf(stderr, "Failed to open file \"%s\" (%d).\n",
-                       args[1], (int) PTR_ERR(fw));
+                       args[1], err);
                goto out;
        }
 
index 7f28179a4acbab43d975ffdc9d2357af1c811113..1786b87a132e45ec7cd4993795d5a91dfe9fa4af 100644 (file)
@@ -275,8 +275,9 @@ int main(int argc, char *args[])
 
        fw = carlfw_load(args[1]);
        if (IS_ERR_OR_NULL(fw)) {
+               err = PTR_ERR(fw);
                fprintf(stderr, "Failed to open file \"%s\" (%d).\n",
-                       args[1], (int) PTR_ERR(fw));
+                       args[1], err);
                goto out;
        }
 
index 3a1a5831db3806c4e6600c7bfcdbd8c215821ae4..5ef3334bbd1d7843026f80fcff395b5e03348f09 100644 (file)
@@ -245,8 +245,9 @@ int main(int argc, char *args[])
 
        fw = carlfw_load(args[1]);
        if (IS_ERR_OR_NULL(fw)) {
+               err = PTR_ERR(fw);
                fprintf(stderr, "Failed to open firmware \"%s\" (%d).\n",
-                       args[1], (int)PTR_ERR(fw));
+                       args[1], err);
                goto out;
        }