mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2024-11-23 21:14:04 +02:00
libubb/swuart.c: only return error codes or fail silently; don't print messages
This commit is contained in:
parent
506db2d69e
commit
5f3828f710
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user