mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
permngr: do not do ioctl when open already failed.
every fail was put in the systemlog, very noisy.
This commit is contained in:
parent
7a31cda783
commit
803bfdd345
1 changed files with 7 additions and 4 deletions
|
|
@ -32,10 +32,14 @@ int board_ioctl(int ioctl_id, int action, int hex, char* string_buf, int string_
|
|||
IoctlParms.offset = offset;
|
||||
IoctlParms.action = action;
|
||||
IoctlParms.buf = (char*)"";
|
||||
IoctlParms.result = 0;
|
||||
|
||||
if (brcmboard != -1){
|
||||
if ( ioctl(brcmboard, ioctl_id, &IoctlParms) < 0 ) {
|
||||
syslog(LOG_ERR, "ioctl: %d failed", ioctl_id);
|
||||
return(-255);
|
||||
}
|
||||
|
||||
if ( ioctl(brcmboard, ioctl_id, &IoctlParms) < 0 ) {
|
||||
syslog(LOG_ERR, "ioctl: %d failed", ioctl_id);
|
||||
return(-255);
|
||||
}
|
||||
return IoctlParms.result;
|
||||
}
|
||||
|
|
@ -46,7 +50,6 @@ gpio_state_t gpio_get_state(gpio_t gpio)
|
|||
return board_ioctl(BOARD_IOCTL_GET_GPIO, 0, 0, NULL, gpio, 0);
|
||||
}
|
||||
|
||||
|
||||
void gpio_set_state(gpio_t gpio, gpio_state_t state)
|
||||
{
|
||||
board_ioctl(BOARD_IOCTL_SET_GPIO, 0, 0, NULL, gpio, state);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue