Commit 278f31a7 authored by Ben Dooks's avatar Ben Dooks Committed by Richard Weinberger

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: default avatarBen Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 569dbb88
...@@ -1166,7 +1166,7 @@ static int __init ubi_init(void) ...@@ -1166,7 +1166,7 @@ static int __init ubi_init(void)
BUILD_BUG_ON(sizeof(struct ubi_vid_hdr) != 64); BUILD_BUG_ON(sizeof(struct ubi_vid_hdr) != 64);
if (mtd_devs > UBI_MAX_DEVICES) { if (mtd_devs > UBI_MAX_DEVICES) {
pr_err("UBI error: too many MTD devices, maximum is %d", pr_err("UBI error: too many MTD devices, maximum is %d\n",
UBI_MAX_DEVICES); UBI_MAX_DEVICES);
return -EINVAL; return -EINVAL;
} }
...@@ -1178,7 +1178,7 @@ static int __init ubi_init(void) ...@@ -1178,7 +1178,7 @@ static int __init ubi_init(void)
err = misc_register(&ubi_ctrl_cdev); err = misc_register(&ubi_ctrl_cdev);
if (err) { if (err) {
pr_err("UBI error: cannot register device"); pr_err("UBI error: cannot register device\n");
goto out; goto out;
} }
...@@ -1205,7 +1205,7 @@ static int __init ubi_init(void) ...@@ -1205,7 +1205,7 @@ static int __init ubi_init(void)
mtd = open_mtd_device(p->name); mtd = open_mtd_device(p->name);
if (IS_ERR(mtd)) { if (IS_ERR(mtd)) {
err = PTR_ERR(mtd); err = PTR_ERR(mtd);
pr_err("UBI error: cannot open mtd %s, error %d", pr_err("UBI error: cannot open mtd %s, error %d\n",
p->name, err); p->name, err);
/* See comment below re-ubi_is_module(). */ /* See comment below re-ubi_is_module(). */
if (ubi_is_module()) if (ubi_is_module())
...@@ -1218,7 +1218,7 @@ static int __init ubi_init(void) ...@@ -1218,7 +1218,7 @@ static int __init ubi_init(void)
p->vid_hdr_offs, p->max_beb_per1024); p->vid_hdr_offs, p->max_beb_per1024);
mutex_unlock(&ubi_devices_mutex); mutex_unlock(&ubi_devices_mutex);
if (err < 0) { if (err < 0) {
pr_err("UBI error: cannot attach mtd%d", pr_err("UBI error: cannot attach mtd%d\n",
mtd->index); mtd->index);
put_mtd_device(mtd); put_mtd_device(mtd);
...@@ -1242,7 +1242,7 @@ static int __init ubi_init(void) ...@@ -1242,7 +1242,7 @@ static int __init ubi_init(void)
err = ubiblock_init(); err = ubiblock_init();
if (err) { if (err) {
pr_err("UBI error: block: cannot initialize, error %d", err); pr_err("UBI error: block: cannot initialize, error %d\n", err);
/* See comment above re-ubi_is_module(). */ /* See comment above re-ubi_is_module(). */
if (ubi_is_module()) if (ubi_is_module())
...@@ -1265,7 +1265,7 @@ static int __init ubi_init(void) ...@@ -1265,7 +1265,7 @@ static int __init ubi_init(void)
misc_deregister(&ubi_ctrl_cdev); misc_deregister(&ubi_ctrl_cdev);
out: out:
class_unregister(&ubi_class); class_unregister(&ubi_class);
pr_err("UBI error: cannot initialize UBI, error %d", err); pr_err("UBI error: cannot initialize UBI, error %d\n", err);
return err; return err;
} }
late_initcall(ubi_init); late_initcall(ubi_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment