mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
mfd: convert to idr_alloc()
Convert to the much saner new idr interface. Signed-off-by: Tejun Heo <[email protected]> Cc: Samuel Ortiz <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
7b51f47835
commit
9f12563db1
1 changed files with 6 additions and 7 deletions
|
|
@ -1091,15 +1091,14 @@ static int rtsx_pci_probe(struct pci_dev *pcidev,
|
|||
}
|
||||
handle->pcr = pcr;
|
||||
|
||||
if (!idr_pre_get(&rtsx_pci_idr, GFP_KERNEL)) {
|
||||
ret = -ENOMEM;
|
||||
goto free_handle;
|
||||
}
|
||||
|
||||
idr_preload(GFP_KERNEL);
|
||||
spin_lock(&rtsx_pci_lock);
|
||||
ret = idr_get_new(&rtsx_pci_idr, pcr, &pcr->id);
|
||||
ret = idr_alloc(&rtsx_pci_idr, pcr, 0, 0, GFP_NOWAIT);
|
||||
if (ret >= 0)
|
||||
pcr->id = ret;
|
||||
spin_unlock(&rtsx_pci_lock);
|
||||
if (ret)
|
||||
idr_preload_end();
|
||||
if (ret < 0)
|
||||
goto free_handle;
|
||||
|
||||
pcr->pci = pcidev;
|
||||
|
|
|
|||
Loading…
Reference in a new issue