Skip to content

Commit 278f31a

Browse files
bjdooks-ctrichardweinberger
authored andcommitted
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>
1 parent 569dbb8 commit 278f31a

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

drivers/mtd/ubi/build.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ static int __init ubi_init(void)
11661166
BUILD_BUG_ON(sizeof(struct ubi_vid_hdr) != 64);
11671167

11681168
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",
11701170
UBI_MAX_DEVICES);
11711171
return -EINVAL;
11721172
}
@@ -1178,7 +1178,7 @@ static int __init ubi_init(void)
11781178

11791179
err = misc_register(&ubi_ctrl_cdev);
11801180
if (err) {
1181-
pr_err("UBI error: cannot register device");
1181+
pr_err("UBI error: cannot register device\n");
11821182
goto out;
11831183
}
11841184

@@ -1205,7 +1205,7 @@ static int __init ubi_init(void)
12051205
mtd = open_mtd_device(p->name);
12061206
if (IS_ERR(mtd)) {
12071207
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",
12091209
p->name, err);
12101210
/* See comment below re-ubi_is_module(). */
12111211
if (ubi_is_module())
@@ -1218,7 +1218,7 @@ static int __init ubi_init(void)
12181218
p->vid_hdr_offs, p->max_beb_per1024);
12191219
mutex_unlock(&ubi_devices_mutex);
12201220
if (err < 0) {
1221-
pr_err("UBI error: cannot attach mtd%d",
1221+
pr_err("UBI error: cannot attach mtd%d\n",
12221222
mtd->index);
12231223
put_mtd_device(mtd);
12241224

@@ -1242,7 +1242,7 @@ static int __init ubi_init(void)
12421242

12431243
err = ubiblock_init();
12441244
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);
12461246

12471247
/* See comment above re-ubi_is_module(). */
12481248
if (ubi_is_module())
@@ -1265,7 +1265,7 @@ static int __init ubi_init(void)
12651265
misc_deregister(&ubi_ctrl_cdev);
12661266
out:
12671267
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);
12691269
return err;
12701270
}
12711271
late_initcall(ubi_init);

0 commit comments

Comments
 (0)