aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd/ubi/build.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-12-15 19:56:51 +0200
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-12-26 19:15:14 +0200
commit01f7b309e453dc8499c318f6810f76b606b66134 (patch)
tree7d5d09cbd3e95f9b644859daedecbe2f4cbe797a /drivers/mtd/ubi/build.c
parent49dfc299288fe183b62a3f679a40c91b482d6d73 (diff)
UBI: improve error messages
Always print error code with error messages, sometimes it is extremely helpful info. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/build.c')
-rw-r--r--drivers/mtd/ubi/build.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index b0791f79505..5490a73deca 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -211,7 +211,8 @@ out_eraseblock_size:
out_unregister:
device_unregister(&ubi->dev);
out:
- ubi_err("failed to initialize sysfs for %s", ubi->ubi_name);
+ ubi_err("failed to initialize sysfs for %s, error %d",
+ ubi->ubi_name, err);
return err;
}
@@ -285,7 +286,7 @@ static int uif_init(struct ubi_device *ubi)
err = cdev_add(&ubi->cdev, dev, 1);
if (err) {
- ubi_err("cannot add character device %s", ubi->ubi_name);
+ ubi_err("cannot add character device");
goto out_unreg;
}
@@ -296,8 +297,10 @@ static int uif_init(struct ubi_device *ubi)
for (i = 0; i < ubi->vtbl_slots; i++)
if (ubi->volumes[i]) {
err = ubi_add_volume(ubi, i);
- if (err)
+ if (err) {
+ ubi_err("cannot add volume %d", i);
goto out_volumes;
+ }
}
return 0;
@@ -309,6 +312,7 @@ out_cdev:
cdev_del(&ubi->cdev);
out_unreg:
unregister_chrdev_region(ubi->cdev.dev, ubi->vtbl_slots + 1);
+ ubi_err("cannot initialize UBI %s, error %d", ubi->ubi_name, err);
return err;
}
@@ -422,7 +426,8 @@ static int io_init(struct ubi_device *ubi)
/* Make sure minimal I/O unit is power of 2 */
if (!is_power_of_2(ubi->min_io_size)) {
- ubi_err("bad min. I/O unit");
+ ubi_err("min. I/O unit (%d) is not power of 2",
+ ubi->min_io_size);
return -EINVAL;
}