aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/vmt.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/vmt.c
parentUBI: remove redundant field (diff)
downloadlinux-dev-01f7b309e453dc8499c318f6810f76b606b66134.tar.xz
linux-dev-01f7b309e453dc8499c318f6810f76b606b66134.zip
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 '')
-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 6609c319c83c..787ce9ec17ae 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)
dev = MKDEV(MAJOR(ubi->cdev.dev), vol_id + 1);
err = cdev_add(&vol->cdev, dev, 1);
if (err) {
- ubi_err("cannot add character device for volume %d", vol_id);
+ ubi_err("cannot add character device");
goto out_mapping;
}
@@ -319,8 +319,10 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
vol->dev.class = ubi_class;
sprintf(&vol->dev.bus_id[0], "%s_%d", ubi->ubi_name, vol->vol_id);
err = device_register(&vol->dev);
- if (err)
+ if (err) {
+ ubi_err("cannot register device");
goto out_gluebi;
+ }
err = volume_sysfs_init(ubi, vol);
if (err)
@@ -364,6 +366,7 @@ out_acc:
out_unlock:
spin_unlock(&ubi->volumes_lock);
kfree(vol);
+ ubi_err("cannot create volume %d, error %d", vol_id, err);
return err;
/*
@@ -380,6 +383,7 @@ out_sysfs:
ubi->volumes[vol_id] = NULL;
spin_unlock(&ubi->volumes_lock);
volume_sysfs_close(vol);
+ ubi_err("cannot create volume %d, error %d", vol_id, err);
return err;
}
@@ -591,7 +595,8 @@ int ubi_add_volume(struct ubi_device *ubi, int vol_id)
dev = MKDEV(MAJOR(ubi->cdev.dev), vol->vol_id + 1);
err = cdev_add(&vol->cdev, dev, 1);
if (err) {
- ubi_err("cannot add character device for volume %d", vol_id);
+ ubi_err("cannot add character device for volume %d, error %d",
+ vol_id, err);
return err;
}