aboutsummaryrefslogtreecommitdiffstats
path: root/fs/pstore
diff options
context:
space:
mode:
authorAnton Vorontsov <anton.vorontsov@linaro.org>2012-05-26 09:20:27 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-13 19:59:37 -0400
commitb8587daa756141da776e3d4c3a5a315f5af78708 (patch)
tree15e29b87b0f1eb7f92eb0d07cf3f4e6f03157687 /fs/pstore
parent958502d836cf18c6f39bdb787b76d53839e4d8aa (diff)
pstore/ram_core: Remove now unused code
The code tried to maintain the global list of persistent ram zones, which isn't a great idea overall, plus since Android's ram_console is no longer there, we can remove some unused functions. Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org> Acked-by: Kees Cook <keescook@chromium.org> Acked-by: Colin Cross <ccross@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/pstore')
-rw-r--r--fs/pstore/ram_core.c77
1 files changed, 0 insertions, 77 deletions
diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
index 78f6d4b2addb..0fd81611525c 100644
--- a/fs/pstore/ram_core.c
+++ b/fs/pstore/ram_core.c
@@ -35,8 +35,6 @@ struct persistent_ram_buffer {
35 35
36#define PERSISTENT_RAM_SIG (0x43474244) /* DBGC */ 36#define PERSISTENT_RAM_SIG (0x43474244) /* DBGC */
37 37
38static __initdata LIST_HEAD(persistent_ram_list);
39
40static inline size_t buffer_size(struct persistent_ram_zone *prz) 38static inline size_t buffer_size(struct persistent_ram_zone *prz)
41{ 39{
42 return atomic_read(&prz->buffer->size); 40 return atomic_read(&prz->buffer->size);
@@ -462,78 +460,3 @@ err:
462 kfree(prz); 460 kfree(prz);
463 return ERR_PTR(ret); 461 return ERR_PTR(ret);
464} 462}
465
466#ifndef MODULE
467static int __init persistent_ram_buffer_init(const char *name,
468 struct persistent_ram_zone *prz)
469{
470 int i;
471 struct persistent_ram *ram;
472 struct persistent_ram_descriptor *desc;
473 phys_addr_t start;
474
475 list_for_each_entry(ram, &persistent_ram_list, node) {
476 start = ram->start;
477 for (i = 0; i < ram->num_descs; i++) {
478 desc = &ram->descs[i];
479 if (!strcmp(desc->name, name))
480 return persistent_ram_buffer_map(start,
481 desc->size, prz);
482 start += desc->size;
483 }
484 }
485
486 return -EINVAL;
487}
488
489static __init
490struct persistent_ram_zone *__persistent_ram_init(struct device *dev, bool ecc)
491{
492 struct persistent_ram_zone *prz;
493 int ret = -ENOMEM;
494
495 prz = kzalloc(sizeof(struct persistent_ram_zone), GFP_KERNEL);
496 if (!prz) {
497 pr_err("persistent_ram: failed to allocate persistent ram zone\n");
498 goto err;
499 }
500
501 ret = persistent_ram_buffer_init(dev_name(dev), prz);
502 if (ret) {
503 pr_err("persistent_ram: failed to initialize buffer\n");
504 goto err;
505 }
506
507 persistent_ram_post_init(prz, ecc);
508
509 return prz;
510err:
511 kfree(prz);
512 return ERR_PTR(ret);
513}
514
515struct persistent_ram_zone * __init
516persistent_ram_init_ringbuffer(struct device *dev, bool ecc)
517{
518 return __persistent_ram_init(dev, ecc);
519}
520
521int __init persistent_ram_early_init(struct persistent_ram *ram)
522{
523 int ret;
524
525 ret = memblock_reserve(ram->start, ram->size);
526 if (ret) {
527 pr_err("Failed to reserve persistent memory from %08lx-%08lx\n",
528 (long)ram->start, (long)(ram->start + ram->size - 1));
529 return ret;
530 }
531
532 list_add_tail(&ram->node, &persistent_ram_list);
533
534 pr_info("Initialized persistent memory from %08lx-%08lx\n",
535 (long)ram->start, (long)(ram->start + ram->size - 1));
536
537 return 0;
538}
539#endif