diff options
Diffstat (limited to 'drivers/edac/edac_device.c')
-rw-r--r-- | drivers/edac/edac_device.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c index a7d2c717d033..b02a6a69a8f0 100644 --- a/drivers/edac/edac_device.c +++ b/drivers/edac/edac_device.c | |||
@@ -490,6 +490,20 @@ void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev, | |||
490 | mutex_unlock(&device_ctls_mutex); | 490 | mutex_unlock(&device_ctls_mutex); |
491 | } | 491 | } |
492 | 492 | ||
493 | /* | ||
494 | * edac_device_alloc_index: Allocate a unique device index number | ||
495 | * | ||
496 | * Return: | ||
497 | * allocated index number | ||
498 | */ | ||
499 | int edac_device_alloc_index(void) | ||
500 | { | ||
501 | static atomic_t device_indexes = ATOMIC_INIT(0); | ||
502 | |||
503 | return atomic_inc_return(&device_indexes) - 1; | ||
504 | } | ||
505 | EXPORT_SYMBOL_GPL(edac_device_alloc_index); | ||
506 | |||
493 | /** | 507 | /** |
494 | * edac_device_add_device: Insert the 'edac_dev' structure into the | 508 | * edac_device_add_device: Insert the 'edac_dev' structure into the |
495 | * edac_device global list and create sysfs entries associated with | 509 | * edac_device global list and create sysfs entries associated with |