Add CONFIG_DEBUG_ERROR. Change names of *dbg() * *err()

This commit is contained in:
Gregory Nutt
2016-06-11 15:50:49 -06:00
parent e99301d7c2
commit a1469a3e95
1091 changed files with 5971 additions and 5966 deletions
+2 -2
View File
@@ -86,7 +86,7 @@ int bchdev_register(FAR const char *blkdev, FAR const char *chardev,
ret = bchlib_setup(blkdev, readonly, &handle);
if (ret < 0)
{
fdbg("bchlib_setup failed: %d\n", -ret);
ferr("bchlib_setup failed: %d\n", -ret);
return ret;
}
@@ -95,7 +95,7 @@ int bchdev_register(FAR const char *blkdev, FAR const char *chardev,
ret = register_driver(chardev, &bch_fops, 0666, handle);
if (ret < 0)
{
fdbg("register_driver failed: %d\n", -ret);
ferr("register_driver failed: %d\n", -ret);
bchlib_teardown(handle);
handle = NULL;
}
+2 -2
View File
@@ -103,7 +103,7 @@ int bchdev_unregister(FAR const char *chardev)
fd = open(chardev, O_RDONLY);
if (fd < 0)
{
dbg("Failed to open %s: %d\n", chardev, errno);
err("Failed to open %s: %d\n", chardev, errno);
return -errno;
}
@@ -116,7 +116,7 @@ int bchdev_unregister(FAR const char *chardev)
if (ret < 0)
{
dbg("ioctl failed: %d\n", errno);
err("ioctl failed: %d\n", errno);
return -errno;
}
+2 -2
View File
@@ -156,7 +156,7 @@ int bchlib_flushsector(FAR struct bchlib_s *bch)
ret = inode->u.i_bops->write(inode, bch->buffer, bch->sector, 1);
if (ret < 0)
{
fdbg("Write failed: %d\n");
ferr("Write failed: %d\n");
}
#if defined(CONFIG_BCH_ENCRYPTION)
@@ -201,7 +201,7 @@ int bchlib_readsector(FAR struct bchlib_s *bch, size_t sector)
ret = inode->u.i_bops->read(inode, bch->buffer, sector, 1);
if (ret < 0)
{
fdbg("Read failed: %d\n");
ferr("Read failed: %d\n");
}
bch->sector = sector;
#if defined(CONFIG_BCH_ENCRYPTION)
+1 -1
View File
@@ -160,7 +160,7 @@ ssize_t bchlib_read(FAR void *handle, FAR char *buffer, size_t offset, size_t le
sector, nsectors);
if (ret < 0)
{
fdbg("Read failed: %d\n");
ferr("Read failed: %d\n");
return ret;
}
+6 -6
View File
@@ -96,7 +96,7 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle)
bch = (FAR struct bchlib_s *)kmm_zalloc(sizeof(struct bchlib_s));
if (!bch)
{
fdbg("Failed to allocate BCH structure\n");
ferr("Failed to allocate BCH structure\n");
return -ENOMEM;
}
@@ -105,7 +105,7 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle)
ret = open_blockdriver(blkdev, readonly ? MS_RDONLY : 0, &bch->inode);
if (ret < 0)
{
fdbg("Failed to open driver %s: %d\n", blkdev, -ret);
ferr("Failed to open driver %s: %d\n", blkdev, -ret);
goto errout_with_bch;
}
@@ -114,20 +114,20 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle)
ret = bch->inode->u.i_bops->geometry(bch->inode, &geo);
if (ret < 0)
{
fdbg("geometry failed: %d\n", -ret);
ferr("geometry failed: %d\n", -ret);
goto errout_with_bch;
}
if (!geo.geo_available)
{
fdbg("geometry failed: %d\n", -ret);
ferr("geometry failed: %d\n", -ret);
ret = -ENODEV;
goto errout_with_bch;
}
if (!readonly && (!bch->inode->u.i_bops->write || !geo.geo_writeenabled))
{
fdbg("write access not supported\n");
ferr("write access not supported\n");
ret = -EACCES;
goto errout_with_bch;
}
@@ -145,7 +145,7 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle)
bch->buffer = (FAR uint8_t *)kmm_malloc(bch->sectsize);
if (!bch->buffer)
{
fdbg("Failed to allocate sector buffer\n");
ferr("Failed to allocate sector buffer\n");
ret = -ENOMEM;
goto errout_with_bch;
}
+2 -2
View File
@@ -162,7 +162,7 @@ ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, size_t offset, si
sector, nsectors);
if (ret < 0)
{
fdbg("Write failed: %d\n", ret);
ferr("Write failed: %d\n", ret);
return ret;
}
@@ -204,7 +204,7 @@ ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, size_t offset, si
ret = bchlib_flushsector(bch);
if (ret < 0)
{
fdbg("Flush failed: %d\n", ret);
ferr("Flush failed: %d\n", ret);
return ret;
}