aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/vmt.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-12-15 12:56:51 -0500
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-12-26 12:15:14 -0500
commit01f7b309e453dc8499c318f6810f76b606b66134 (patch)
tree7d5d09cbd3e95f9b644859daedecbe2f4cbe797a /drivers/mtd/ubi/vmt.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/vmt.c')
-rw-r--r--drivers/mtd/ubi/vmt.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
index 6609c319c83..787ce9ec17a 100644
--- a/drivers/mtd/ubi/vmt.c
+++ b/drivers/mtd/ubi/vmt.c
@@ -305,7 +305,7 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
305 dev = MKDEV(MAJOR(ubi->cdev.dev), vol_id + 1); 305 dev = MKDEV(MAJOR(ubi->cdev.dev), vol_id + 1);
306 err = cdev_add(&vol->cdev, dev, 1); 306 err = cdev_add(&vol->cdev, dev, 1);
307 if (err) { 307 if (err) {
308 ubi_err("cannot add character device for volume %d", vol_id); 308 ubi_err("cannot add character device");
309 goto out_mapping; 309 goto out_mapping;
310 } 310 }
311 311
@@ -319,8 +319,10 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
319 vol->dev.class = ubi_class; 319 vol->dev.class = ubi_class;
320 sprintf(&vol->dev.bus_id[0], "%s_%d", ubi->ubi_name, vol->vol_id); 320 sprintf(&vol->dev.bus_id[0], "%s_%d", ubi->ubi_name, vol->vol_id);
321 err = device_register(&vol->dev); 321 err = device_register(&vol->dev);
322 if (err) 322 if (err) {
323 ubi_err("cannot register device");
323 goto out_gluebi; 324 goto out_gluebi;
325 }
324 326
325 err = volume_sysfs_init(ubi, vol); 327 err = volume_sysfs_init(ubi, vol);
326 if (err) 328 if (err)
@@ -364,6 +366,7 @@ out_acc:
364out_unlock: 366out_unlock:
365 spin_unlock(&ubi->volumes_lock); 367 spin_unlock(&ubi->volumes_lock);
366 kfree(vol); 368 kfree(vol);
369 ubi_err("cannot create volume %d, error %d", vol_id, err);
367 return err; 370 return err;
368 371
369 /* 372 /*
@@ -380,6 +383,7 @@ out_sysfs:
380 ubi->volumes[vol_id] = NULL; 383 ubi->volumes[vol_id] = NULL;
381 spin_unlock(&ubi->volumes_lock); 384 spin_unlock(&ubi->volumes_lock);
382 volume_sysfs_close(vol); 385 volume_sysfs_close(vol);
386 ubi_err("cannot create volume %d, error %d", vol_id, err);
383 return err; 387 return err;
384} 388}
385 389
@@ -591,7 +595,8 @@ int ubi_add_volume(struct ubi_device *ubi, int vol_id)
591 dev = MKDEV(MAJOR(ubi->cdev.dev), vol->vol_id + 1); 595 dev = MKDEV(MAJOR(ubi->cdev.dev), vol->vol_id + 1);
592 err = cdev_add(&vol->cdev, dev, 1); 596 err = cdev_add(&vol->cdev, dev, 1);
593 if (err) { 597 if (err) {
594 ubi_err("cannot add character device for volume %d", vol_id); 598 ubi_err("cannot add character device for volume %d, error %d",
599 vol_id, err);
595 return err; 600 return err;
596 } 601 }
597 602