Commit 7aa7aef1 authored by Alessandro Rubini's avatar Alessandro Rubini

usb-loader: fix error path and typo in 'make clean'

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 81250fc8
......@@ -16,4 +16,4 @@ version.c: ../.git/HEAD ../.git/index
echo "" >> $@
clean:
rm -f version.c $(OBJS) $(OUTPUT):q:q
rm -f version.c $(OBJS) $(OUTPUT)
......@@ -4,6 +4,7 @@
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <getopt.h>
#include <libgen.h>
......@@ -609,7 +610,11 @@ main(int argc, char *argv[])
printf("n=%d, mode=%s, nFile=%d, serial=%s, (e=%d,c=%d,s=%d)\n", argc, mode_str, nFile, serial_port, erase,check,scrub);
serial_open(serial_port, PORT_SPEED);
if (serial_open(serial_port, PORT_SPEED) < 0) {
fprintf(stderr, "%s: %s: %s\n", argv[0], serial_port,
strerror(errno));
exit(1);
}
fprintf(stderr,"Initializing SAM-BA: ");
samba_connect(board_rev);
......
......@@ -21,7 +21,7 @@
#include <termios.h>
#include <fcntl.h>
static int serial_fd;
static int serial_fd = -1;
void serial_set_dtr(int s) // pin 4
{
......@@ -137,4 +137,4 @@ void sys_delay(int msecs)
void serial_purge()
{
while(serial_data_avail()) serial_read_byte();
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment