diff options
author | Sergiu Iordache <sergiu@chromium.org> | 2011-07-26 19:08:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-26 19:49:45 -0400 |
commit | 6b4d2a2733b9a17112f746d498c9f9a0427dcdd8 (patch) | |
tree | c0c637da5ede8828728bad87fba41e7ca7f11ca1 /drivers/char/ramoops.c | |
parent | 0169256e4bbf29e507cdd1df5812c093d610f1d5 (diff) |
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: Sergiu Iordache <sergiu@chromium.org>
Acked-by: Marco 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/ramoops.c')
-rw-r--r-- | drivers/char/ramoops.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/char/ramoops.c b/drivers/char/ramoops.c index c9e1028766a4..5349d94e17da 100644 --- a/drivers/char/ramoops.c +++ b/drivers/char/ramoops.c | |||
@@ -55,6 +55,7 @@ static struct ramoops_context { | |||
55 | void *virt_addr; | 55 | void *virt_addr; |
56 | phys_addr_t phys_addr; | 56 | phys_addr_t phys_addr; |
57 | unsigned long size; | 57 | unsigned long size; |
58 | int dump_oops; | ||
58 | int count; | 59 | int count; |
59 | int max_count; | 60 | int max_count; |
60 | } oops_cxt; | 61 | } oops_cxt; |
@@ -80,7 +81,7 @@ static void ramoops_do_dump(struct kmsg_dumper *dumper, | |||
80 | return; | 81 | return; |
81 | 82 | ||
82 | /* Only dump oopses if dump_oops is set */ | 83 | /* Only dump oopses if dump_oops is set */ |
83 | if (reason == KMSG_DUMP_OOPS && !dump_oops) | 84 | if (reason == KMSG_DUMP_OOPS && !cxt->dump_oops) |
84 | return; | 85 | return; |
85 | 86 | ||
86 | buf = cxt->virt_addr + (cxt->count * RECORD_SIZE); | 87 | buf = cxt->virt_addr + (cxt->count * RECORD_SIZE); |
@@ -128,6 +129,7 @@ static int __init ramoops_probe(struct platform_device *pdev) | |||
128 | cxt->count = 0; | 129 | cxt->count = 0; |
129 | cxt->size = pdata->mem_size; | 130 | cxt->size = pdata->mem_size; |
130 | cxt->phys_addr = pdata->mem_address; | 131 | cxt->phys_addr = pdata->mem_address; |
132 | cxt->dump_oops = pdata->dump_oops; | ||
131 | 133 | ||
132 | if (!request_mem_region(cxt->phys_addr, cxt->size, "ramoops")) { | 134 | if (!request_mem_region(cxt->phys_addr, cxt->size, "ramoops")) { |
133 | pr_err("request mem region failed\n"); | 135 | pr_err("request mem region failed\n"); |
@@ -194,6 +196,7 @@ static int __init ramoops_init(void) | |||
194 | return -ENOMEM; | 196 | return -ENOMEM; |
195 | dummy_data->mem_size = mem_size; | 197 | dummy_data->mem_size = mem_size; |
196 | dummy_data->mem_address = mem_address; | 198 | dummy_data->mem_address = mem_address; |
199 | dummy_data->dump_oops = dump_oops; | ||
197 | dummy = platform_create_bundle(&ramoops_driver, ramoops_probe, | 200 | dummy = platform_create_bundle(&ramoops_driver, ramoops_probe, |
198 | NULL, 0, dummy_data, | 201 | NULL, 0, dummy_data, |
199 | sizeof(struct ramoops_platform_data)); | 202 | sizeof(struct ramoops_platform_data)); |