Commit 304e9158 authored by Richard Weinberger's avatar Richard Weinberger Committed by Sasha Levin

ubi: Fix early logging

[ Upstream commit bc743f34 ]

We cannot use ubi_* logging functions before the UBI
object is initialized.

Cc: <stable@vger.kernel.org>
Fixes: 32608703 ("UBI: Extend UBI layer debug/messaging capabilities")
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent ae32d1b9
...@@ -887,7 +887,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, ...@@ -887,7 +887,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
for (i = 0; i < UBI_MAX_DEVICES; i++) { for (i = 0; i < UBI_MAX_DEVICES; i++) {
ubi = ubi_devices[i]; ubi = ubi_devices[i];
if (ubi && mtd->index == ubi->mtd->index) { if (ubi && mtd->index == ubi->mtd->index) {
ubi_err(ubi, "mtd%d is already attached to ubi%d", pr_err("ubi: mtd%d is already attached to ubi%d",
mtd->index, i); mtd->index, i);
return -EEXIST; return -EEXIST;
} }
...@@ -902,7 +902,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, ...@@ -902,7 +902,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
* no sense to attach emulated MTD devices, so we prohibit this. * no sense to attach emulated MTD devices, so we prohibit this.
*/ */
if (mtd->type == MTD_UBIVOLUME) { if (mtd->type == MTD_UBIVOLUME) {
ubi_err(ubi, "refuse attaching mtd%d - it is already emulated on top of UBI", pr_err("ubi: refuse attaching mtd%d - it is already emulated on top of UBI",
mtd->index); mtd->index);
return -EINVAL; return -EINVAL;
} }
...@@ -913,7 +913,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, ...@@ -913,7 +913,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
if (!ubi_devices[ubi_num]) if (!ubi_devices[ubi_num])
break; break;
if (ubi_num == UBI_MAX_DEVICES) { if (ubi_num == UBI_MAX_DEVICES) {
ubi_err(ubi, "only %d UBI devices may be created", pr_err("ubi: only %d UBI devices may be created",
UBI_MAX_DEVICES); UBI_MAX_DEVICES);
return -ENFILE; return -ENFILE;
} }
...@@ -923,7 +923,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, ...@@ -923,7 +923,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
/* Make sure ubi_num is not busy */ /* Make sure ubi_num is not busy */
if (ubi_devices[ubi_num]) { if (ubi_devices[ubi_num]) {
ubi_err(ubi, "already exists"); pr_err("ubi: ubi%i already exists", ubi_num);
return -EEXIST; return -EEXIST;
} }
} }
......
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