Commit 6b4d2a27 authored by Sergiu Iordache's avatar Sergiu Iordache Committed by Linus Torvalds

ramoops: move dump_oops into platform data

The platform driver currently allows setting the mem_size and
mem_address.

ince dump_oops is also a module parameter it would be more consistent if
it could be set through platform data as well.
Signed-off-by: default avatarSergiu Iordache <sergiu@chromium.org>
Acked-by: default avatarMarco Stornelli <marco.stornelli@gmail.com>
Cc: "Ahmed S. Darwish" <darwish.07@gmail.com>
Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0169256e
...@@ -55,6 +55,7 @@ static struct ramoops_context { ...@@ -55,6 +55,7 @@ static struct ramoops_context {
void *virt_addr; void *virt_addr;
phys_addr_t phys_addr; phys_addr_t phys_addr;
unsigned long size; unsigned long size;
int dump_oops;
int count; int count;
int max_count; int max_count;
} oops_cxt; } oops_cxt;
...@@ -80,7 +81,7 @@ static void ramoops_do_dump(struct kmsg_dumper *dumper, ...@@ -80,7 +81,7 @@ static void ramoops_do_dump(struct kmsg_dumper *dumper,
return; return;
/* Only dump oopses if dump_oops is set */ /* Only dump oopses if dump_oops is set */
if (reason == KMSG_DUMP_OOPS && !dump_oops) if (reason == KMSG_DUMP_OOPS && !cxt->dump_oops)
return; return;
buf = cxt->virt_addr + (cxt->count * RECORD_SIZE); buf = cxt->virt_addr + (cxt->count * RECORD_SIZE);
...@@ -128,6 +129,7 @@ static int __init ramoops_probe(struct platform_device *pdev) ...@@ -128,6 +129,7 @@ static int __init ramoops_probe(struct platform_device *pdev)
cxt->count = 0; cxt->count = 0;
cxt->size = pdata->mem_size; cxt->size = pdata->mem_size;
cxt->phys_addr = pdata->mem_address; cxt->phys_addr = pdata->mem_address;
cxt->dump_oops = pdata->dump_oops;
if (!request_mem_region(cxt->phys_addr, cxt->size, "ramoops")) { if (!request_mem_region(cxt->phys_addr, cxt->size, "ramoops")) {
pr_err("request mem region failed\n"); pr_err("request mem region failed\n");
...@@ -194,6 +196,7 @@ static int __init ramoops_init(void) ...@@ -194,6 +196,7 @@ static int __init ramoops_init(void)
return -ENOMEM; return -ENOMEM;
dummy_data->mem_size = mem_size; dummy_data->mem_size = mem_size;
dummy_data->mem_address = mem_address; dummy_data->mem_address = mem_address;
dummy_data->dump_oops = dump_oops;
dummy = platform_create_bundle(&ramoops_driver, ramoops_probe, dummy = platform_create_bundle(&ramoops_driver, ramoops_probe,
NULL, 0, dummy_data, NULL, 0, dummy_data,
sizeof(struct ramoops_platform_data)); sizeof(struct ramoops_platform_data));
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
struct ramoops_platform_data { struct ramoops_platform_data {
unsigned long mem_size; unsigned long mem_size;
unsigned long mem_address; unsigned long mem_address;
int dump_oops;
}; };
#endif #endif
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