mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
edac: Add edac_pci_alloc_index()
Add edac_pci_alloc_index(), because for MAPLE platform there may exist several EDAC driver modules that could make use of edac_pci_ctl_info structure at the same time. The index allocation for these structures should be taken care of by EDAC core. Signed-off-by: Harry Ciao <[email protected]> Cc: Doug Thompson <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
697dab6484
commit
8641a3845d
2 changed files with 15 additions and 0 deletions
|
|
@ -844,6 +844,7 @@ extern void edac_pci_free_ctl_info(struct edac_pci_ctl_info *pci);
|
|||
extern void edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci,
|
||||
unsigned long value);
|
||||
|
||||
extern int edac_pci_alloc_index(void);
|
||||
extern int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx);
|
||||
extern struct edac_pci_ctl_info *edac_pci_del_device(struct device *dev);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
static DEFINE_MUTEX(edac_pci_ctls_mutex);
|
||||
static LIST_HEAD(edac_pci_list);
|
||||
static atomic_t pci_indexes = ATOMIC_INIT(0);
|
||||
|
||||
/*
|
||||
* edac_pci_alloc_ctl_info
|
||||
|
|
@ -317,6 +318,19 @@ void edac_pci_reset_delay_period(struct edac_pci_ctl_info *pci,
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period);
|
||||
|
||||
/*
|
||||
* edac_pci_alloc_index: Allocate a unique PCI index number
|
||||
*
|
||||
* Return:
|
||||
* allocated index number
|
||||
*
|
||||
*/
|
||||
int edac_pci_alloc_index(void)
|
||||
{
|
||||
return atomic_inc_return(&pci_indexes) - 1;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(edac_pci_alloc_index);
|
||||
|
||||
/*
|
||||
* edac_pci_add_device: Insert the 'edac_dev' structure into the
|
||||
* edac_pci global list and create sysfs entries associated with
|
||||
|
|
|
|||
Loading…
Reference in a new issue