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