aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Dooks <ben.dooks@codethink.co.uk>2017-07-26 05:42:54 -0400
committerRichard Weinberger <richard@nod.at>2017-09-13 16:05:30 -0400
commit278f31a70d2e40aa31bf465795bfce2ca8bb01b6 (patch)
tree0b09bad3dc2382bcf08623cf3df77397b434bde0
parent569dbb88e80deb68974ef6fdd6a13edb9d686261 (diff)
ubi: pr_err() strings should end with newlines
The ubi_init() function has a few error paths that use the pr_err() to output errors. These should have new lines on them as pr_err() does not automatically do this. This fixes issues where if multiple mtd fail to bind to ubi the console output starts wrapping around. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r--drivers/mtd/ubi/build.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index d854521962ef..f9c576b8463e 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -1166,7 +1166,7 @@ static int __init ubi_init(void)
1166 BUILD_BUG_ON(sizeof(struct ubi_vid_hdr) != 64); 1166 BUILD_BUG_ON(sizeof(struct ubi_vid_hdr) != 64);
1167 1167
1168 if (mtd_devs > UBI_MAX_DEVICES) { 1168 if (mtd_devs > UBI_MAX_DEVICES) {
1169 pr_err("UBI error: too many MTD devices, maximum is %d", 1169 pr_err("UBI error: too many MTD devices, maximum is %d\n",
1170 UBI_MAX_DEVICES); 1170 UBI_MAX_DEVICES);
1171 return -EINVAL; 1171 return -EINVAL;
1172 } 1172 }
@@ -1178,7 +1178,7 @@ static int __init ubi_init(void)
1178 1178
1179 err = misc_register(&ubi_ctrl_cdev); 1179 err = misc_register(&ubi_ctrl_cdev);
1180 if (err) { 1180 if (err) {
1181 pr_err("UBI error: cannot register device"); 1181 pr_err("UBI error: cannot register device\n");
1182 goto out; 1182 goto out;
1183 } 1183 }
1184 1184
@@ -1205,7 +1205,7 @@ static int __init ubi_init(void)
1205 mtd = open_mtd_device(p->name); 1205 mtd = open_mtd_device(p->name);
1206 if (IS_ERR(mtd)) { 1206 if (IS_ERR(mtd)) {
1207 err = PTR_ERR(mtd); 1207 err = PTR_ERR(mtd);
1208 pr_err("UBI error: cannot open mtd %s, error %d", 1208 pr_err("UBI error: cannot open mtd %s, error %d\n",
1209 p->name, err); 1209 p->name, err);
1210 /* See comment below re-ubi_is_module(). */ 1210 /* See comment below re-ubi_is_module(). */
1211 if (ubi_is_module()) 1211 if (ubi_is_module())
@@ -1218,7 +1218,7 @@ static int __init ubi_init(void)
1218 p->vid_hdr_offs, p->max_beb_per1024); 1218 p->vid_hdr_offs, p->max_beb_per1024);
1219 mutex_unlock(&ubi_devices_mutex); 1219 mutex_unlock(&ubi_devices_mutex);
1220 if (err < 0) { 1220 if (err < 0) {
1221 pr_err("UBI error: cannot attach mtd%d", 1221 pr_err("UBI error: cannot attach mtd%d\n",
1222 mtd->index); 1222 mtd->index);
1223 put_mtd_device(mtd); 1223 put_mtd_device(mtd);
1224 1224
@@ -1242,7 +1242,7 @@ static int __init ubi_init(void)
1242 1242
1243 err = ubiblock_init(); 1243 err = ubiblock_init();
1244 if (err) { 1244 if (err) {
1245 pr_err("UBI error: block: cannot initialize, error %d", err); 1245 pr_err("UBI error: block: cannot initialize, error %d\n", err);
1246 1246
1247 /* See comment above re-ubi_is_module(). */ 1247 /* See comment above re-ubi_is_module(). */
1248 if (ubi_is_module()) 1248 if (ubi_is_module())
@@ -1265,7 +1265,7 @@ out_dev_unreg:
1265 misc_deregister(&ubi_ctrl_cdev); 1265 misc_deregister(&ubi_ctrl_cdev);
1266out: 1266out:
1267 class_unregister(&ubi_class); 1267 class_unregister(&ubi_class);
1268 pr_err("UBI error: cannot initialize UBI, error %d", err); 1268 pr_err("UBI error: cannot initialize UBI, error %d\n", err);
1269 return err; 1269 return err;
1270} 1270}
1271late_initcall(ubi_init); 1271late_initcall(ubi_init);