When boardctl() fails, need to print errno not the returned value which will always be -1.

This commit is contained in:
Gregory Nutt
2015-04-16 07:24:48 -06:00
parent 5bdacd2f17
commit 3e01a06431
3 changed files with 5 additions and 5 deletions

View File

@@ -252,9 +252,9 @@ int adc_main(int argc, char *argv[])
printf("adc_main: Initializing external ADC device\n");
ret = boardctl(BOARDIOC_ADCTEST_SETUP, 0);
if (ret != OK)
if (ret < 0)
{
printf("adc_main: boardctl failed: %d\n", ret);
printf("adc_main: boardctl failed: %d\n", errno);
errval = 1;
goto errout;
}