diff options
Diffstat (limited to 'arch/powerpc/kernel/nvram_64.c')
-rw-r--r-- | arch/powerpc/kernel/nvram_64.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index f9676f52c6d8..0ed31f220482 100644 --- a/arch/powerpc/kernel/nvram_64.c +++ b/arch/powerpc/kernel/nvram_64.c | |||
@@ -34,21 +34,10 @@ | |||
34 | 34 | ||
35 | #undef DEBUG_NVRAM | 35 | #undef DEBUG_NVRAM |
36 | 36 | ||
37 | static int nvram_scan_partitions(void); | ||
38 | static int nvram_setup_partition(void); | ||
39 | static int nvram_create_os_partition(void); | ||
40 | static int nvram_remove_os_partition(void); | ||
41 | |||
42 | static struct nvram_partition * nvram_part; | 37 | static struct nvram_partition * nvram_part; |
43 | static long nvram_error_log_index = -1; | 38 | static long nvram_error_log_index = -1; |
44 | static long nvram_error_log_size = 0; | 39 | static long nvram_error_log_size = 0; |
45 | 40 | ||
46 | int no_logging = 1; /* Until we initialize everything, | ||
47 | * make sure we don't try logging | ||
48 | * anything */ | ||
49 | |||
50 | extern volatile int error_log_cnt; | ||
51 | |||
52 | struct err_log_info { | 41 | struct err_log_info { |
53 | int error_type; | 42 | int error_type; |
54 | unsigned int seq_num; | 43 | unsigned int seq_num; |
@@ -636,16 +625,13 @@ void __exit nvram_cleanup(void) | |||
636 | * sequence #: The unique sequence # for each event. (until it wraps) | 625 | * sequence #: The unique sequence # for each event. (until it wraps) |
637 | * error log: The error log from event_scan | 626 | * error log: The error log from event_scan |
638 | */ | 627 | */ |
639 | int nvram_write_error_log(char * buff, int length, unsigned int err_type) | 628 | int nvram_write_error_log(char * buff, int length, |
629 | unsigned int err_type, unsigned int error_log_cnt) | ||
640 | { | 630 | { |
641 | int rc; | 631 | int rc; |
642 | loff_t tmp_index; | 632 | loff_t tmp_index; |
643 | struct err_log_info info; | 633 | struct err_log_info info; |
644 | 634 | ||
645 | if (no_logging) { | ||
646 | return -EPERM; | ||
647 | } | ||
648 | |||
649 | if (nvram_error_log_index == -1) { | 635 | if (nvram_error_log_index == -1) { |
650 | return -ESPIPE; | 636 | return -ESPIPE; |
651 | } | 637 | } |
@@ -678,7 +664,8 @@ int nvram_write_error_log(char * buff, int length, unsigned int err_type) | |||
678 | * | 664 | * |
679 | * Reads nvram for error log for at most 'length' | 665 | * Reads nvram for error log for at most 'length' |
680 | */ | 666 | */ |
681 | int nvram_read_error_log(char * buff, int length, unsigned int * err_type) | 667 | int nvram_read_error_log(char * buff, int length, |
668 | unsigned int * err_type, unsigned int * error_log_cnt) | ||
682 | { | 669 | { |
683 | int rc; | 670 | int rc; |
684 | loff_t tmp_index; | 671 | loff_t tmp_index; |
@@ -704,7 +691,7 @@ int nvram_read_error_log(char * buff, int length, unsigned int * err_type) | |||
704 | return rc; | 691 | return rc; |
705 | } | 692 | } |
706 | 693 | ||
707 | error_log_cnt = info.seq_num; | 694 | *error_log_cnt = info.seq_num; |
708 | *err_type = info.error_type; | 695 | *err_type = info.error_type; |
709 | 696 | ||
710 | return 0; | 697 | return 0; |