diff options
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/edac_core.h | 1 | ||||
-rw-r--r-- | drivers/edac/edac_pci.c | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h index 3189c76fe62e..28f2c3f959b5 100644 --- a/drivers/edac/edac_core.h +++ b/drivers/edac/edac_core.h | |||
@@ -844,6 +844,7 @@ extern void edac_pci_free_ctl_info(struct edac_pci_ctl_info *pci); | |||
844 | extern void edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci, | 844 | extern void edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci, |
845 | unsigned long value); | 845 | unsigned long value); |
846 | 846 | ||
847 | extern int edac_pci_alloc_index(void); | ||
847 | extern int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx); | 848 | extern int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx); |
848 | extern struct edac_pci_ctl_info *edac_pci_del_device(struct device *dev); | 849 | extern struct edac_pci_ctl_info *edac_pci_del_device(struct device *dev); |
849 | 850 | ||
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c index 5d3c8083a40e..5b150aea703a 100644 --- a/drivers/edac/edac_pci.c +++ b/drivers/edac/edac_pci.c | |||
@@ -30,6 +30,7 @@ | |||
30 | 30 | ||
31 | static DEFINE_MUTEX(edac_pci_ctls_mutex); | 31 | static DEFINE_MUTEX(edac_pci_ctls_mutex); |
32 | static LIST_HEAD(edac_pci_list); | 32 | static LIST_HEAD(edac_pci_list); |
33 | static atomic_t pci_indexes = ATOMIC_INIT(0); | ||
33 | 34 | ||
34 | /* | 35 | /* |
35 | * edac_pci_alloc_ctl_info | 36 | * edac_pci_alloc_ctl_info |
@@ -318,6 +319,19 @@ void edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci, | |||
318 | EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period); | 319 | EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period); |
319 | 320 | ||
320 | /* | 321 | /* |
322 | * edac_pci_alloc_index: Allocate a unique PCI index number | ||
323 | * | ||
324 | * Return: | ||
325 | * allocated index number | ||
326 | * | ||
327 | */ | ||
328 | int edac_pci_alloc_index(void) | ||
329 | { | ||
330 | return atomic_inc_return(&pci_indexes) - 1; | ||
331 | } | ||
332 | EXPORT_SYMBOL_GPL(edac_pci_alloc_index); | ||
333 | |||
334 | /* | ||
321 | * edac_pci_add_device: Insert the 'edac_dev' structure into the | 335 | * edac_pci_add_device: Insert the 'edac_dev' structure into the |
322 | * edac_pci global list and create sysfs entries associated with | 336 | * edac_pci global list and create sysfs entries associated with |
323 | * edac_pci structure. | 337 | * edac_pci structure. |