diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-12-15 12:56:51 -0500 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-12-26 12:15:14 -0500 |
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: | |||
211 | out_unregister: | 211 | out_unregister: |
212 | device_unregister(&ubi->dev); | 212 | device_unregister(&ubi->dev); |
213 | out: | 213 | out: |
214 | ubi_err("failed to initialize sysfs for %s", ubi->ubi_name); | 214 | ubi_err("failed to initialize sysfs for %s, error %d", |
215 | ubi->ubi_name, err); | ||
215 | return err; | 216 | return err; |
216 | } | 217 | } |
217 | 218 | ||
@@ -285,7 +286,7 @@ static int uif_init(struct ubi_device *ubi) | |||
285 | 286 | ||
286 | err = cdev_add(&ubi->cdev, dev, 1); | 287 | err = cdev_add(&ubi->cdev, dev, 1); |
287 | if (err) { | 288 | if (err) { |
288 | ubi_err("cannot add character device %s", ubi->ubi_name); | 289 | ubi_err("cannot add character device"); |
289 | goto out_unreg; | 290 | goto out_unreg; |
290 | } | 291 | } |
291 | 292 | ||
@@ -296,8 +297,10 @@ static int uif_init(struct ubi_device *ubi) | |||
296 | for (i = 0; i < ubi->vtbl_slots; i++) | 297 | for (i = 0; i < ubi->vtbl_slots; i++) |
297 | if (ubi->volumes[i]) { | 298 | if (ubi->volumes[i]) { |
298 | err = ubi_add_volume(ubi, i); | 299 | err = ubi_add_volume(ubi, i); |
299 | if (err) | 300 | if (err) { |
301 | ubi_err("cannot add volume %d", i); | ||
300 | goto out_volumes; | 302 | goto out_volumes; |
303 | } | ||
301 | } | 304 | } |
302 | 305 | ||
303 | return 0; | 306 | return 0; |
@@ -309,6 +312,7 @@ out_cdev: | |||
309 | cdev_del(&ubi->cdev); | 312 | cdev_del(&ubi->cdev); |
310 | out_unreg: | 313 | out_unreg: |
311 | unregister_chrdev_region(ubi->cdev.dev, ubi->vtbl_slots + 1); | 314 | unregister_chrdev_region(ubi->cdev.dev, ubi->vtbl_slots + 1); |
315 | ubi_err("cannot initialize UBI %s, error %d", ubi->ubi_name, err); | ||
312 | return err; | 316 | return err; |
313 | } | 317 | } |
314 | 318 | ||
@@ -422,7 +426,8 @@ static int io_init(struct ubi_device *ubi) | |||
422 | 426 | ||
423 | /* Make sure minimal I/O unit is power of 2 */ | 427 | /* Make sure minimal I/O unit is power of 2 */ |
424 | if (!is_power_of_2(ubi->min_io_size)) { | 428 | if (!is_power_of_2(ubi->min_io_size)) { |
425 | ubi_err("bad min. I/O unit"); | 429 | ubi_err("min. I/O unit (%d) is not power of 2", |
430 | ubi->min_io_size); | ||
426 | return -EINVAL; | 431 | return -EINVAL; |
427 | } | 432 | } |
428 | 433 | ||