Olimex STM32 H407: Handle initialization errors consistently

This commit is contained in:
Gregory Nutt 2016-04-05 17:40:51 -06:00
parent f07be860dd
commit 85574ad023

View File

@ -105,7 +105,9 @@ int stm32_bringup(void)
ret = stm32_can_initialize(); ret = stm32_can_initialize();
if (ret != OK) if (ret != OK)
{ {
syslog(LOG_ERR, "ERROR: Failed to initialize CAN: %d\n", ret); syslog(LOG_ERR,
"ERROR: Failed to initialize CAN: %d\n",
ret);
} }
#endif #endif
@ -115,7 +117,9 @@ int stm32_bringup(void)
ret = stm32_adc_initialize(); ret = stm32_adc_initialize();
if (ret != OK) if (ret != OK)
{ {
syslog(LOG_ERR, "ERROR: Failed to initialize ADC: %d\n", ret); syslog(LOG_ERR,
"ERROR: Failed to initialize ADC: %d\n",
ret);
} }
#endif #endif
@ -125,8 +129,9 @@ int stm32_bringup(void)
ret = stm32_sdio_initialize(); ret = stm32_sdio_initialize();
if (ret != OK) if (ret != OK)
{ {
fdbg("ERROR: Failed to initialize MMC/SD driver: %d\n", ret); syslog(LOG_ERR,
return ret; "ERROR: Failed to initialize MMC/SD driver: %d\n",
ret);
} }
#endif #endif
@ -138,8 +143,9 @@ int stm32_bringup(void)
ret = stm32_usbhost_initialize(); ret = stm32_usbhost_initialize();
if (ret != OK) if (ret != OK)
{ {
syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret); syslog(LOG_ERR,
return ret; "ERROR: Failed to initialize USB host: %d\n",
ret);
} }
#endif #endif
@ -149,7 +155,9 @@ int stm32_bringup(void)
ret = usbmonitor_start(0, NULL); ret = usbmonitor_start(0, NULL);
if (ret != OK) if (ret != OK)
{ {
syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret); syslog(LOG_ERR,
"ERROR: Failed to start USB monitor: %d\n",
ret);
} }
#endif #endif