From 3f2e5386597bf990669ccbcf204a92cc19df2c87 Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Mon, 16 Feb 2009 18:21:35 +0200 Subject: [PATCH] --- yaml --- r: 142312 b: refs/heads/master c: e2a0f25b4f520adbd82c0caafcde0470ed11053d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/mtd/mtdoops.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index b4cc82c60178..a31f29086fe8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f271049e2010b918f83dc1c7bbd5d75f4710506a +refs/heads/master: e2a0f25b4f520adbd82c0caafcde0470ed11053d diff --git a/trunk/drivers/mtd/mtdoops.c b/trunk/drivers/mtd/mtdoops.c index 1a6b3beabe8d..fdf504fb319a 100644 --- a/trunk/drivers/mtd/mtdoops.c +++ b/trunk/drivers/mtd/mtdoops.c @@ -44,6 +44,7 @@ static struct mtdoops_context { int oops_pages; int nextpage; int nextcount; + char *name; void *oops_buf; @@ -273,6 +274,9 @@ static void mtdoops_notify_add(struct mtd_info *mtd) { struct mtdoops_context *cxt = &oops_cxt; + if (cxt->name && !strcmp(mtd->name, cxt->name)) + cxt->mtd_index = mtd->index; + if ((mtd->index != cxt->mtd_index) || cxt->mtd_index < 0) return; @@ -383,8 +387,12 @@ static int __init mtdoops_console_setup(struct console *co, char *options) { struct mtdoops_context *cxt = co->data; - if (cxt->mtd_index != -1) + if (cxt->mtd_index != -1 || cxt->name) return -EBUSY; + if (options) { + cxt->name = kstrdup(options, GFP_KERNEL); + return 0; + } if (co->index == -1) return -EINVAL; @@ -432,6 +440,7 @@ static void __exit mtdoops_console_exit(void) unregister_mtd_user(&mtdoops_notifier); unregister_console(&mtdoops_console); + kfree(cxt->name); vfree(cxt->oops_buf); }