aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/edac/edac_mc.c28
-rw-r--r--drivers/edac/edac_mc.h1
2 files changed, 29 insertions, 0 deletions
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 804875de5801..c1a8bf2bfa57 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -1457,6 +1457,34 @@ static void del_mc_from_global_list(struct mem_ctl_info *mci)
1457} 1457}
1458 1458
1459/** 1459/**
1460 * edac_mc_find: Search for a mem_ctl_info structure whose index is 'idx'.
1461 *
1462 * If found, return a pointer to the structure.
1463 * Else return NULL.
1464 *
1465 * Caller must hold mem_ctls_mutex.
1466 */
1467struct mem_ctl_info * edac_mc_find(int idx)
1468{
1469 struct list_head *item;
1470 struct mem_ctl_info *mci;
1471
1472 list_for_each(item, &mc_devices) {
1473 mci = list_entry(item, struct mem_ctl_info, link);
1474
1475 if (mci->mc_idx >= idx) {
1476 if (mci->mc_idx == idx)
1477 return mci;
1478
1479 break;
1480 }
1481 }
1482
1483 return NULL;
1484}
1485EXPORT_SYMBOL(edac_mc_find);
1486
1487/**
1460 * edac_mc_add_mc: Insert the 'mci' structure into the mci global list and 1488 * edac_mc_add_mc: Insert the 'mci' structure into the mci global list and
1461 * create sysfs entries associated with mci structure 1489 * create sysfs entries associated with mci structure
1462 * @mci: pointer to the mci structure to be added to the list 1490 * @mci: pointer to the mci structure to be added to the list
diff --git a/drivers/edac/edac_mc.h b/drivers/edac/edac_mc.h
index 713444cc4105..9ad8a20a8de5 100644
--- a/drivers/edac/edac_mc.h
+++ b/drivers/edac/edac_mc.h
@@ -430,6 +430,7 @@ void edac_mc_dump_mci(struct mem_ctl_info *mci);
430void edac_mc_dump_csrow(struct csrow_info *csrow); 430void edac_mc_dump_csrow(struct csrow_info *csrow);
431#endif /* CONFIG_EDAC_DEBUG */ 431#endif /* CONFIG_EDAC_DEBUG */
432 432
433extern struct mem_ctl_info * edac_mc_find(int idx);
433extern int edac_mc_add_mc(struct mem_ctl_info *mci,int mc_idx); 434extern int edac_mc_add_mc(struct mem_ctl_info *mci,int mc_idx);
434extern struct mem_ctl_info * edac_mc_del_mc(struct device *dev); 435extern struct mem_ctl_info * edac_mc_del_mc(struct device *dev);
435extern int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci, 436extern int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci,