aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_mc.c
diff options
context:
space:
mode:
authorDoug Thompson <dougthompson@xmission.com>2007-07-19 04:50:26 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 13:04:57 -0400
commitb8f6f9755248026f21282e25cac49a1af698056c (patch)
treec133319ae70b99d60415aa833719911d47420297 /drivers/edac/edac_mc.c
parentfd309a9d8e63e9176759d00630b65d772ae06e0c (diff)
drivers/edac: fix edac_mc init apis
Refactoring of sysfs code necessitated the refactoring of the edac_mc_alloc() and edac_mc_add_mc() apis, of moving the index value to the alloc() function. This patch alters the in tree drivers to utilize this new api signature. Having the index value performed later created a chicken-and-the-egg issue. Moving it to the alloc() function allows for creating the necessary sysfs entries with the proper index number Cc: Alan Cox alan@lxorguk.ukuu.org.uk Signed-off-by: Doug Thompson <dougthompson@xmission.com> Cc: Greg KH <greg@kroah.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.c')
-rw-r--r--drivers/edac/edac_mc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 856860314789..6e4c94e9654a 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -129,7 +129,7 @@ void *edac_align_ptr(void *ptr, unsigned size)
129 * struct mem_ctl_info pointer 129 * struct mem_ctl_info pointer
130 */ 130 */
131struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows, 131struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows,
132 unsigned nr_chans) 132 unsigned nr_chans, int edac_index)
133{ 133{
134 struct mem_ctl_info *mci; 134 struct mem_ctl_info *mci;
135 struct csrow_info *csi, *csrow; 135 struct csrow_info *csi, *csrow;
@@ -159,7 +159,8 @@ struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows,
159 chi = (struct channel_info *)(((char *)mci) + ((unsigned long)chi)); 159 chi = (struct channel_info *)(((char *)mci) + ((unsigned long)chi));
160 pvt = sz_pvt ? (((char *)mci) + ((unsigned long)pvt)) : NULL; 160 pvt = sz_pvt ? (((char *)mci) + ((unsigned long)pvt)) : NULL;
161 161
162 memset(mci, 0, size); /* clear all fields */ 162 /* setup index and various internal pointers */
163 mci->mc_idx = edac_index;
163 mci->csrows = csi; 164 mci->csrows = csi;
164 mci->pvt_info = pvt; 165 mci->pvt_info = pvt;
165 mci->nr_csrows = nr_csrows; 166 mci->nr_csrows = nr_csrows;
@@ -405,10 +406,10 @@ EXPORT_SYMBOL(edac_mc_find);
405 */ 406 */
406 407
407/* FIXME - should a warning be printed if no error detection? correction? */ 408/* FIXME - should a warning be printed if no error detection? correction? */
408int edac_mc_add_mc(struct mem_ctl_info *mci, int mc_idx) 409int edac_mc_add_mc(struct mem_ctl_info *mci)
409{ 410{
410 debugf0("%s()\n", __func__); 411 debugf0("%s()\n", __func__);
411 mci->mc_idx = mc_idx; 412
412#ifdef CONFIG_EDAC_DEBUG 413#ifdef CONFIG_EDAC_DEBUG
413 if (edac_debug_level >= 3) 414 if (edac_debug_level >= 3)
414 edac_mc_dump_mci(mci); 415 edac_mc_dump_mci(mci);