From 5f3828f7109a3ba0661b955ace81be5b68c5b098 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Mon, 31 Dec 2012 19:27:16 -0300 Subject: [PATCH] libubb/swuart.c: only return error codes or fail silently; don't print messages --- libubb/swuart.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libubb/swuart.c b/libubb/swuart.c index 4ff81a6..da1b977 100644 --- a/libubb/swuart.c +++ b/libubb/swuart.c @@ -12,7 +12,6 @@ #include -#include #include #include @@ -238,10 +237,8 @@ int swuart_open(uint32_t tx, uint32_t rx, int bps) * Make sure code and rx/tx buffers are locked into memory before we * disable interrupts in swuart_trx. */ - if (mlockall(MCL_CURRENT | MCL_FUTURE)) { - perror("mlockall"); + if (mlockall(MCL_CURRENT | MCL_FUTURE)) return -1; - } ticks = TCLK/bps-1; tx_mask = tx; @@ -257,6 +254,5 @@ int swuart_open(uint32_t tx, uint32_t rx, int bps) void swuart_close(void) { - if (munlockall()) - perror("munlockall"); + munlockall(); }