aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-02-12 09:36:41 -0500
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-04-17 04:31:59 -0400
commitc4506092c1773211b71a75bd557c02b090c82b66 (patch)
tree79e5aca3f160ca0a6237aa92a41340017a764317 /drivers/mtd
parent92a74f1c1c9ca4d8009bfdea1c5febb7c0674f15 (diff)
UBI: fix error printing
Use existing ubi_err() as the rest of the code does. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/build.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 275960462970..1e0e4e689d3e 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -950,8 +950,7 @@ static int __init ubi_init(void)
950 BUILD_BUG_ON(sizeof(struct ubi_vid_hdr) != 64); 950 BUILD_BUG_ON(sizeof(struct ubi_vid_hdr) != 64);
951 951
952 if (mtd_devs > UBI_MAX_DEVICES) { 952 if (mtd_devs > UBI_MAX_DEVICES) {
953 printk(KERN_ERR "UBI error: too many MTD devices, " 953 ubi_err("too many MTD devices, maximum is %d", UBI_MAX_DEVICES);
954 "maximum is %d\n", UBI_MAX_DEVICES);
955 return -EINVAL; 954 return -EINVAL;
956 } 955 }
957 956
@@ -959,25 +958,25 @@ static int __init ubi_init(void)
959 ubi_class = class_create(THIS_MODULE, UBI_NAME_STR); 958 ubi_class = class_create(THIS_MODULE, UBI_NAME_STR);
960 if (IS_ERR(ubi_class)) { 959 if (IS_ERR(ubi_class)) {
961 err = PTR_ERR(ubi_class); 960 err = PTR_ERR(ubi_class);
962 printk(KERN_ERR "UBI error: cannot create UBI class\n"); 961 ubi_err("cannot create UBI class");
963 goto out; 962 goto out;
964 } 963 }
965 964
966 err = class_create_file(ubi_class, &ubi_version); 965 err = class_create_file(ubi_class, &ubi_version);
967 if (err) { 966 if (err) {
968 printk(KERN_ERR "UBI error: cannot create sysfs file\n"); 967 ubi_err("cannot create sysfs file");
969 goto out_class; 968 goto out_class;
970 } 969 }
971 970
972 err = misc_register(&ubi_ctrl_cdev); 971 err = misc_register(&ubi_ctrl_cdev);
973 if (err) { 972 if (err) {
974 printk(KERN_ERR "UBI error: cannot register device\n"); 973 ubi_err("cannot register device");
975 goto out_version; 974 goto out_version;
976 } 975 }
977 976
978 ubi_wl_entry_slab = kmem_cache_create("ubi_wl_entry_slab", 977 ubi_wl_entry_slab = kmem_cache_create("ubi_wl_entry_slab",
979 sizeof(struct ubi_wl_entry), 978 sizeof(struct ubi_wl_entry),
980 0, 0, NULL); 979 0, 0, NULL);
981 if (!ubi_wl_entry_slab) 980 if (!ubi_wl_entry_slab)
982 goto out_dev_unreg; 981 goto out_dev_unreg;
983 982
@@ -1000,8 +999,7 @@ static int __init ubi_init(void)
1000 mutex_unlock(&ubi_devices_mutex); 999 mutex_unlock(&ubi_devices_mutex);
1001 if (err < 0) { 1000 if (err < 0) {
1002 put_mtd_device(mtd); 1001 put_mtd_device(mtd);
1003 printk(KERN_ERR "UBI error: cannot attach mtd%d\n", 1002 ubi_err("cannot attach mtd%d", mtd->index);
1004 mtd->index);
1005 goto out_detach; 1003 goto out_detach;
1006 } 1004 }
1007 } 1005 }
@@ -1023,7 +1021,7 @@ out_version:
1023out_class: 1021out_class:
1024 class_destroy(ubi_class); 1022 class_destroy(ubi_class);
1025out: 1023out:
1026 printk(KERN_ERR "UBI error: cannot initialize UBI, error %d\n", err); 1024 ubi_err("UBI error: cannot initialize UBI, error %d", err);
1027 return err; 1025 return err;
1028} 1026}
1029module_init(ubi_init); 1027module_init(ubi_init);