diff options
author | Artem Bityutskiy | 2007-12-15 19:56:51 +0200 |
---|---|---|
committer | Artem Bityutskiy | 2007-12-26 19:15:14 +0200 |
commit | 01f7b309e453dc8499c318f6810f76b606b66134 (patch) | |
tree | 7d5d09cbd3e95f9b644859daedecbe2f4cbe797a /drivers/mtd/ubi/build.c | |
parent | 49dfc299288fe183b62a3f679a40c91b482d6d73 (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.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index b0791f795056..5490a73deca5 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; } |