mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
SAMV71-XULT: Use syslog(LOG_ERR, ..) not the supposedly hidden _err() macro.
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
@@ -120,14 +121,15 @@ static void sam_i2c_register(int bus)
|
||||
i2c = sam_i2cbus_initialize(bus);
|
||||
if (i2c == NULL)
|
||||
{
|
||||
_err("ERROR: Failed to get I2C%d interface\n", bus);
|
||||
syslog(LOG_ERR, "ERROR: Failed to get I2C%d interface\n", bus);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = i2c_register(i2c, bus);
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: Failed to register I2C%d driver: %d\n", bus, ret);
|
||||
syslog(LOG_ERR, "ERROR: Failed to register I2C%d driver: %d\n",
|
||||
bus, ret);
|
||||
sam_i2cbus_uninitialize(i2c);
|
||||
}
|
||||
}
|
||||
@@ -198,7 +200,8 @@ int sam_bringup(void)
|
||||
ret = userled_lower_initialize(LED_DRIVER_PATH);
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n",
|
||||
ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -208,7 +211,8 @@ int sam_bringup(void)
|
||||
i2c = sam_i2cbus_initialize(PCF85263_TWI_BUS);
|
||||
if (i2c == NULL)
|
||||
{
|
||||
_err("ERROR: sam_i2cbus_initialize(%d) failed\n", PCF85263_TWI_BUS);
|
||||
syslog(LOG_ERR, "ERROR: sam_i2cbus_initialize(%d) failed\n",
|
||||
PCF85263_TWI_BUS);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -217,7 +221,8 @@ int sam_bringup(void)
|
||||
ret = pcf85263_rtc_initialize(i2c);
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: pcf85263_rtc_initialize() failed: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: pcf85263_rtc_initialize() failed: %d\n",
|
||||
ret);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -233,7 +238,8 @@ int sam_bringup(void)
|
||||
i2c = sam_i2cbus_initialize(DSXXXX_TWI_BUS);
|
||||
if (i2c == NULL)
|
||||
{
|
||||
_err("ERROR: sam_i2cbus_initialize(%d) failed\n", DSXXXX_TWI_BUS);
|
||||
syslog(LOG_ERR, "ERROR: sam_i2cbus_initialize(%d) failed\n",
|
||||
DSXXXX_TWI_BUS);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -242,7 +248,8 @@ int sam_bringup(void)
|
||||
ret = dsxxxx_rtc_initialize(i2c);
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: dsxxxx_rtc_initialize() failed: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: dsxxxx_rtc_initialize() failed: %d\n",
|
||||
ret);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -271,7 +278,7 @@ int sam_bringup(void)
|
||||
ret = sam_emac0_setmac();
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: sam_emac0_setmac() failed: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: sam_emac0_setmac() failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -281,8 +288,8 @@ int sam_bringup(void)
|
||||
ret = mount(NULL, SAMV71_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: Failed to mount procfs at %s: %d\n",
|
||||
SAMV71_PROCFS_MOUNTPOINT, ret);
|
||||
syslog(LOG_ERR, "ERROR: Failed to mount procfs at %s: %d\n",
|
||||
SAMV71_PROCFS_MOUNTPOINT, ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -294,7 +301,7 @@ int sam_bringup(void)
|
||||
ret = sam_at24config();
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: sam_at24config() failed: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: sam_at24config() failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -304,8 +311,8 @@ int sam_bringup(void)
|
||||
ret = sam_hsmci_initialize(HSMCI0_SLOTNO, HSMCI0_MINOR);
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n",
|
||||
HSMCI0_SLOTNO, HSMCI0_MINOR, ret);
|
||||
syslog(LOG_ERR, "ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n",
|
||||
HSMCI0_SLOTNO, HSMCI0_MINOR, ret);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SAMV71XULT_HSMCI0_MOUNT
|
||||
@@ -321,8 +328,8 @@ int sam_bringup(void)
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: Failed to mount %s: %d\n",
|
||||
CONFIG_SAMV71XULT_HSMCI0_MOUNT_MOUNTPOINT, errno);
|
||||
syslog(LOG_ERR, "ERROR: Failed to mount %s: %d\n",
|
||||
CONFIG_SAMV71XULT_HSMCI0_MOUNT_MOUNTPOINT, errno);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +350,7 @@ int sam_bringup(void)
|
||||
CONFIG_SAMV71XULT_ROMFS_ROMDISK_SECTSIZE);
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: romdisk_register failed: %d\n", -ret);
|
||||
syslog(LOG_ERR, "ERROR: romdisk_register failed: %d\n", -ret);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -354,9 +361,9 @@ int sam_bringup(void)
|
||||
"romfs", MS_RDONLY, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: mount(%s,%s,romfs) failed: %d\n",
|
||||
CONFIG_SAMV71XULT_ROMFS_ROMDISK_DEVNAME,
|
||||
CONFIG_SAMV71XULT_ROMFS_MOUNT_MOUNTPOINT, errno);
|
||||
syslog(LOG_ERR, "ERROR: mount(%s,%s,romfs) failed: %d\n",
|
||||
CONFIG_SAMV71XULT_ROMFS_ROMDISK_DEVNAME,
|
||||
CONFIG_SAMV71XULT_ROMFS_MOUNT_MOUNTPOINT, errno);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -367,7 +374,7 @@ int sam_bringup(void)
|
||||
qspi = sam_qspi_initialize(0);
|
||||
if (!qspi)
|
||||
{
|
||||
_err("ERROR: sam_qspi_initialize failed\n");
|
||||
syslog(LOG_ERR, "ERROR: sam_qspi_initialize failed\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -378,7 +385,7 @@ int sam_bringup(void)
|
||||
mtd = s25fl1_initialize(qspi, true);
|
||||
if (!mtd)
|
||||
{
|
||||
_err("ERROR: s25fl1_initialize failed\n");
|
||||
syslog(LOG_ERR, "ERROR: s25fl1_initialize failed\n");
|
||||
}
|
||||
|
||||
#ifdef HAVE_S25FL1_SMARTFS
|
||||
@@ -387,7 +394,7 @@ int sam_bringup(void)
|
||||
ret = smart_initialize(S25FL1_SMART_MINOR, mtd, NULL);
|
||||
if (ret != OK)
|
||||
{
|
||||
_err("ERROR: Failed to initialize SmartFS: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize SmartFS: %d\n", ret);
|
||||
}
|
||||
|
||||
#elif defined(HAVE_S25FL1_NXFFS)
|
||||
@@ -396,7 +403,7 @@ int sam_bringup(void)
|
||||
ret = nxffs_initialize(mtd);
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: NXFFS initialization failed: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: NXFFS initialization failed: %d\n", ret);
|
||||
}
|
||||
|
||||
/* Mount the file system at /mnt/s25fl1 */
|
||||
@@ -404,7 +411,8 @@ int sam_bringup(void)
|
||||
ret = mount(NULL, "/mnt/s25fl1", "nxffs", 0, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: Failed to mount the NXFFS volume: %d\n", errno);
|
||||
syslog(LOG_ERR, "ERROR: Failed to mount the NXFFS volume: %d\n",
|
||||
errno);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -414,7 +422,8 @@ int sam_bringup(void)
|
||||
ret = ftl_initialize(S25FL1_MTD_MINOR, mtd);
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: Failed to initialize the FTL layer: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize the FTL layer: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -428,7 +437,8 @@ int sam_bringup(void)
|
||||
ret = bchdev_register(blockdev, chardev, false);
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: bchdev_register %s failed: %d\n", chardev, ret);
|
||||
syslog(LOG_ERR, "ERROR: bchdev_register %s failed: %d\n",
|
||||
chardev, ret);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
@@ -445,7 +455,7 @@ int sam_bringup(void)
|
||||
mtd = progmem_initialize();
|
||||
if (!mtd)
|
||||
{
|
||||
_err("ERROR: progmem_initialize failed\n");
|
||||
syslog(LOG_ERR, "ERROR: progmem_initialize failed\n");
|
||||
}
|
||||
|
||||
/* Use the FTL layer to wrap the MTD driver as a block driver */
|
||||
@@ -453,7 +463,8 @@ int sam_bringup(void)
|
||||
ret = ftl_initialize(PROGMEM_MTD_MINOR, mtd);
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: Failed to initialize the FTL layer: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize the FTL layer: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -467,7 +478,8 @@ int sam_bringup(void)
|
||||
ret = bchdev_register(blockdev, chardev, false);
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: bchdev_register %s failed: %d\n", chardev, ret);
|
||||
syslog(LOG_ERR, "ERROR: bchdev_register %s failed: %d\n",
|
||||
chardev, ret);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
@@ -480,7 +492,7 @@ int sam_bringup(void)
|
||||
ret = sam_usbhost_initialize();
|
||||
if (ret != OK)
|
||||
{
|
||||
_err("ERROR: Failed to initialize USB host: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -490,7 +502,7 @@ int sam_bringup(void)
|
||||
ret = usbmonitor_start();
|
||||
if (ret != OK)
|
||||
{
|
||||
_err("ERROR: Failed to start the USB monitor: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: Failed to start the USB monitor: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -500,7 +512,8 @@ int sam_bringup(void)
|
||||
ret = sam_wm8904_initialize(0);
|
||||
if (ret != OK)
|
||||
{
|
||||
_err("ERROR: Failed to initialize WM8904 audio: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize WM8904 audio: %d\n",
|
||||
ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -510,18 +523,22 @@ int sam_bringup(void)
|
||||
ret = sam_audio_null_initialize(0);
|
||||
if (ret != OK)
|
||||
{
|
||||
_err("ERROR: Failed to initialize the NULL audio device: %d\n", ret);
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to initialize the NULL audio device: %d\n",
|
||||
ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ELF
|
||||
/* Initialize the ELF binary loader */
|
||||
|
||||
_err("Initializing the ELF binary loader\n");
|
||||
syslog(LOG_ERR, "Initializing the ELF binary loader\n");
|
||||
ret = elf_initialize();
|
||||
if (ret < 0)
|
||||
{
|
||||
_err("ERROR: Initialization of the ELF loader failed: %d\n", ret);
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Initialization of the ELF loader failed: %d\n",
|
||||
ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user