aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/edac/edac_device.c')
-rw-r--r--drivers/edac/edac_device.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
index b9552bc03dea..63372fa7ecfe 100644
--- a/drivers/edac/edac_device.c
+++ b/drivers/edac/edac_device.c
@@ -36,7 +36,7 @@
36 * is protected by the 'device_ctls_mutex' lock 36 * is protected by the 'device_ctls_mutex' lock
37 */ 37 */
38static DEFINE_MUTEX(device_ctls_mutex); 38static DEFINE_MUTEX(device_ctls_mutex);
39static struct list_head edac_device_list = LIST_HEAD_INIT(edac_device_list); 39static LIST_HEAD(edac_device_list);
40 40
41#ifdef CONFIG_EDAC_DEBUG 41#ifdef CONFIG_EDAC_DEBUG
42static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev) 42static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev)
@@ -375,37 +375,6 @@ static void del_edac_device_from_global_list(struct edac_device_ctl_info
375 wait_for_completion(&edac_device->removal_complete); 375 wait_for_completion(&edac_device->removal_complete);
376} 376}
377 377
378/**
379 * edac_device_find
380 * Search for a edac_device_ctl_info structure whose index is 'idx'.
381 *
382 * If found, return a pointer to the structure.
383 * Else return NULL.
384 *
385 * Caller must hold device_ctls_mutex.
386 */
387struct edac_device_ctl_info *edac_device_find(int idx)
388{
389 struct list_head *item;
390 struct edac_device_ctl_info *edac_dev;
391
392 /* Iterate over list, looking for exact match of ID */
393 list_for_each(item, &edac_device_list) {
394 edac_dev = list_entry(item, struct edac_device_ctl_info, link);
395
396 if (edac_dev->dev_idx >= idx) {
397 if (edac_dev->dev_idx == idx)
398 return edac_dev;
399
400 /* not on list, so terminate early */
401 break;
402 }
403 }
404
405 return NULL;
406}
407EXPORT_SYMBOL_GPL(edac_device_find);
408
409/* 378/*
410 * edac_device_workq_function 379 * edac_device_workq_function
411 * performs the operation scheduled by a workq request 380 * performs the operation scheduled by a workq request