1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-16 18:45:54 +02:00

libubb/swuart.c: only return error codes or fail silently; don't print messages

This commit is contained in:
Werner Almesberger 2012-12-31 19:27:16 -03:00
parent 506db2d69e
commit 5f3828f710

View File

@ -12,7 +12,6 @@
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
@ -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();
}