mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 21:40:53 +07:00
[MTD] mtdoops: Various minor cleanups
Various minor cleaups to mtdoops: * Don't support the mtd->erasesize < OOPS_PAGE_SIZE case * Tweak printks and make the device mtdoops connects to more visible * CON_PRINTBUFFER flag is uneeded Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This commit is contained in:
parent
47c152b88c
commit
79dcd8e9e1
@ -67,9 +67,6 @@ static int mtdoops_erase_block(struct mtd_info *mtd, int offset)
|
|||||||
erase.mtd = mtd;
|
erase.mtd = mtd;
|
||||||
erase.callback = mtdoops_erase_callback;
|
erase.callback = mtdoops_erase_callback;
|
||||||
erase.addr = offset;
|
erase.addr = offset;
|
||||||
if (mtd->erasesize < OOPS_PAGE_SIZE)
|
|
||||||
erase.len = OOPS_PAGE_SIZE;
|
|
||||||
else
|
|
||||||
erase.len = mtd->erasesize;
|
erase.len = mtd->erasesize;
|
||||||
erase.priv = (u_long)&wait_q;
|
erase.priv = (u_long)&wait_q;
|
||||||
|
|
||||||
@ -271,12 +268,18 @@ static void mtdoops_notify_add(struct mtd_info *mtd)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mtd->erasesize < OOPS_PAGE_SIZE) {
|
||||||
|
printk(KERN_ERR "Eraseblock size of MTD partition %d too small\n",
|
||||||
|
mtd->index);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
cxt->mtd = mtd;
|
cxt->mtd = mtd;
|
||||||
cxt->oops_pages = mtd->size / OOPS_PAGE_SIZE;
|
cxt->oops_pages = mtd->size / OOPS_PAGE_SIZE;
|
||||||
|
|
||||||
find_next_position(cxt);
|
find_next_position(cxt);
|
||||||
|
|
||||||
printk(KERN_DEBUG "mtdoops: Attached to MTD device %d\n", mtd->index);
|
printk(KERN_INFO "mtdoops: Attached to MTD device %d\n", mtd->index);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mtdoops_notify_remove(struct mtd_info *mtd)
|
static void mtdoops_notify_remove(struct mtd_info *mtd)
|
||||||
@ -377,7 +380,6 @@ static struct console mtdoops_console = {
|
|||||||
.write = mtdoops_console_write,
|
.write = mtdoops_console_write,
|
||||||
.setup = mtdoops_console_setup,
|
.setup = mtdoops_console_setup,
|
||||||
.unblank = mtdoops_console_sync,
|
.unblank = mtdoops_console_sync,
|
||||||
.flags = CON_PRINTBUFFER,
|
|
||||||
.index = -1,
|
.index = -1,
|
||||||
.data = &oops_cxt,
|
.data = &oops_cxt,
|
||||||
};
|
};
|
||||||
@ -390,7 +392,7 @@ static int __init mtdoops_console_init(void)
|
|||||||
cxt->oops_buf = vmalloc(OOPS_PAGE_SIZE);
|
cxt->oops_buf = vmalloc(OOPS_PAGE_SIZE);
|
||||||
|
|
||||||
if (!cxt->oops_buf) {
|
if (!cxt->oops_buf) {
|
||||||
printk(KERN_ERR "Failed to allocate oops buffer workspace\n");
|
printk(KERN_ERR "Failed to allocate mtdoops buffer workspace\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user