diff options
author | Arthur Jones <ajones@riverbed.com> | 2008-07-25 04:49:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-25 13:53:49 -0400 |
commit | 327dafb1c61c9da7b95ac6cc7634a2340cc9509c (patch) | |
tree | da6d6ba70abd150b0474777ce0fe5406963b19db /drivers/edac/edac_mc_sysfs.c | |
parent | 096846e2b0ef39cb7c348f837f06984ef6ba8aa7 (diff) |
edac: core fix redundant sysfs controls to parameters
/sys/devices/system/edac/mc has a few files which are duplicated in
/sys/module/edac_core/parameters. Now that all the functionality is
duplicated between these two locations, we remove the former kobject
attributes and update the documentation.
Signed-off-by: Arthur Jones <ajones@riverbed.com>
Signed-off-by: Doug Thompson <dougthompson@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/edac/edac_mc_sysfs.c')
-rw-r--r-- | drivers/edac/edac_mc_sysfs.c | 117 |
1 files changed, 1 insertions, 116 deletions
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 7bb9c1532b90..cbe1a17e42f7 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c | |||
@@ -123,16 +123,6 @@ static const char *edac_caps[] = { | |||
123 | 123 | ||
124 | 124 | ||
125 | 125 | ||
126 | /* | ||
127 | * /sys/devices/system/edac/mc; | ||
128 | * data structures and methods | ||
129 | */ | ||
130 | static ssize_t memctrl_int_show(void *ptr, char *buffer) | ||
131 | { | ||
132 | int *value = (int *)ptr; | ||
133 | return sprintf(buffer, "%u\n", *value); | ||
134 | } | ||
135 | |||
136 | static ssize_t memctrl_int_store(void *ptr, const char *buffer, size_t count) | 126 | static ssize_t memctrl_int_store(void *ptr, const char *buffer, size_t count) |
137 | { | 127 | { |
138 | int *value = (int *)ptr; | 128 | int *value = (int *)ptr; |
@@ -143,23 +133,6 @@ static ssize_t memctrl_int_store(void *ptr, const char *buffer, size_t count) | |||
143 | return count; | 133 | return count; |
144 | } | 134 | } |
145 | 135 | ||
146 | /* | ||
147 | * mc poll_msec time value | ||
148 | */ | ||
149 | static ssize_t poll_msec_int_store(void *ptr, const char *buffer, size_t count) | ||
150 | { | ||
151 | int *value = (int *)ptr; | ||
152 | |||
153 | if (isdigit(*buffer)) { | ||
154 | *value = simple_strtoul(buffer, NULL, 0); | ||
155 | |||
156 | /* notify edac_mc engine to reset the poll period */ | ||
157 | edac_mc_reset_delay_period(*value); | ||
158 | } | ||
159 | |||
160 | return count; | ||
161 | } | ||
162 | |||
163 | 136 | ||
164 | /* EDAC sysfs CSROW data structures and methods | 137 | /* EDAC sysfs CSROW data structures and methods |
165 | */ | 138 | */ |
@@ -669,98 +642,10 @@ static struct kobj_type ktype_mci = { | |||
669 | .default_attrs = (struct attribute **)mci_attr, | 642 | .default_attrs = (struct attribute **)mci_attr, |
670 | }; | 643 | }; |
671 | 644 | ||
672 | /* show/store, tables, etc for the MC kset */ | ||
673 | |||
674 | |||
675 | struct memctrl_dev_attribute { | ||
676 | struct attribute attr; | ||
677 | void *value; | ||
678 | ssize_t(*show) (void *, char *); | ||
679 | ssize_t(*store) (void *, const char *, size_t); | ||
680 | }; | ||
681 | |||
682 | /* Set of show/store abstract level functions for memory control object */ | ||
683 | static ssize_t memctrl_dev_show(struct kobject *kobj, | ||
684 | struct attribute *attr, char *buffer) | ||
685 | { | ||
686 | struct memctrl_dev_attribute *memctrl_dev; | ||
687 | memctrl_dev = (struct memctrl_dev_attribute *)attr; | ||
688 | |||
689 | if (memctrl_dev->show) | ||
690 | return memctrl_dev->show(memctrl_dev->value, buffer); | ||
691 | |||
692 | return -EIO; | ||
693 | } | ||
694 | |||
695 | static ssize_t memctrl_dev_store(struct kobject *kobj, struct attribute *attr, | ||
696 | const char *buffer, size_t count) | ||
697 | { | ||
698 | struct memctrl_dev_attribute *memctrl_dev; | ||
699 | memctrl_dev = (struct memctrl_dev_attribute *)attr; | ||
700 | |||
701 | if (memctrl_dev->store) | ||
702 | return memctrl_dev->store(memctrl_dev->value, buffer, count); | ||
703 | |||
704 | return -EIO; | ||
705 | } | ||
706 | |||
707 | static struct sysfs_ops memctrlfs_ops = { | ||
708 | .show = memctrl_dev_show, | ||
709 | .store = memctrl_dev_store | ||
710 | }; | ||
711 | |||
712 | #define MEMCTRL_ATTR(_name, _mode, _show, _store) \ | ||
713 | static struct memctrl_dev_attribute attr_##_name = { \ | ||
714 | .attr = {.name = __stringify(_name), .mode = _mode }, \ | ||
715 | .value = &_name, \ | ||
716 | .show = _show, \ | ||
717 | .store = _store, \ | ||
718 | }; | ||
719 | |||
720 | #define MEMCTRL_STRING_ATTR(_name, _data, _mode, _show, _store) \ | ||
721 | static struct memctrl_dev_attribute attr_##_name = { \ | ||
722 | .attr = {.name = __stringify(_name), .mode = _mode }, \ | ||
723 | .value = _data, \ | ||
724 | .show = _show, \ | ||
725 | .store = _store, \ | ||
726 | }; | ||
727 | |||
728 | /* csrow<id> control files */ | ||
729 | MEMCTRL_ATTR(edac_mc_panic_on_ue, | ||
730 | S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store); | ||
731 | |||
732 | MEMCTRL_ATTR(edac_mc_log_ue, | ||
733 | S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store); | ||
734 | |||
735 | MEMCTRL_ATTR(edac_mc_log_ce, | ||
736 | S_IRUGO | S_IWUSR, memctrl_int_show, memctrl_int_store); | ||
737 | |||
738 | MEMCTRL_ATTR(edac_mc_poll_msec, | ||
739 | S_IRUGO | S_IWUSR, memctrl_int_show, poll_msec_int_store); | ||
740 | |||
741 | /* Base Attributes of the memory ECC object */ | ||
742 | static struct memctrl_dev_attribute *memctrl_attr[] = { | ||
743 | &attr_edac_mc_panic_on_ue, | ||
744 | &attr_edac_mc_log_ue, | ||
745 | &attr_edac_mc_log_ce, | ||
746 | &attr_edac_mc_poll_msec, | ||
747 | NULL, | ||
748 | }; | ||
749 | |||
750 | |||
751 | /* the ktype for the mc_kset internal kobj */ | ||
752 | static struct kobj_type ktype_mc_set_attribs = { | ||
753 | .sysfs_ops = &memctrlfs_ops, | ||
754 | .default_attrs = (struct attribute **)memctrl_attr, | ||
755 | }; | ||
756 | |||
757 | /* EDAC memory controller sysfs kset: | 645 | /* EDAC memory controller sysfs kset: |
758 | * /sys/devices/system/edac/mc | 646 | * /sys/devices/system/edac/mc |
759 | */ | 647 | */ |
760 | static struct kset mc_kset = { | 648 | static struct kset mc_kset; |
761 | .kobj = {.ktype = &ktype_mc_set_attribs }, | ||
762 | }; | ||
763 | |||
764 | 649 | ||
765 | /* | 650 | /* |
766 | * edac_mc_register_sysfs_main_kobj | 651 | * edac_mc_register_sysfs_main_kobj |