board_uniqueid should return a negated errno value on failure

This commit is contained in:
Gregory Nutt 2015-11-19 10:23:01 -06:00
parent 57d84a2143
commit f4213873f3

View File

@ -36,23 +36,34 @@
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#include <nuttx/board.h>
#include <errno.h>
#include "stm32_uid.h"
#include <nuttx/board.h>
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
#ifndef OK
# define OK 0
#endif
#define ERR_NULL 1
/************************************************************************************
* Public Functions
************************************************************************************/
#if defined(CONFIG_BOARDCTL_UNIQUEID)
int board_uniqueid(uint8_t *uniqueid)
{
if(uniqueid == 0)
return -ERR_NULL;
if (uniqueid == 0)
{
return -EINVAL;
}
stm32_get_uniqueid(uniqueid);
return OK;
}