Fix getting error message when successfully using stlinkV2
authorJakub Tyszkowski <tyszja@gmail.com>
Sat, 7 Mar 2015 17:42:16 +0000 (18:42 +0100)
committerJakub Tyszkowski <tyszja@gmail.com>
Sat, 7 Mar 2015 18:18:58 +0000 (19:18 +0100)
When using stlinkV2 you are constantly getting error messages from
'stlink_v1_open' when all goes well and 'stlink_open_usb' is used
instead. This patch fixes this confusing behaviour and makes stlink-sg.c
use logging macros consistently by removing last 'stderr' printout. It
is not needed as 'stlink_v1_open_inner' is verbose enough.

src/stlink-sg.c

index 960455bab14c8db61e6b71efa88ff364345b8134..db68e2f4e3e8adbbadcaf0884f8700dd79badce3 100644 (file)
@@ -1017,10 +1017,9 @@ stlink_t* stlink_v1_open_inner(const int verbose) {
 
 stlink_t* stlink_v1_open(const int verbose, int reset) {
     stlink_t *sl = stlink_v1_open_inner(verbose);
-    if (sl == NULL) {
-        fputs("Error: could not open stlink device\n", stderr);
+    if (sl == NULL)
         return NULL;
-    }
+
     // by now, it _must_ be fully open and in a useful mode....
     stlink_enter_swd_mode(sl);
     /* Now we are ready to read the parameters  */