aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-02-27 20:04:29 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-27 22:10:17 -0500
commit9f12563db1e079aaf9821104e6dfff4873b3f4b6 (patch)
tree0ace988157e877cf7a816c81d1910f3d7fd78f8f /drivers/mfd
parent7b51f47835f61d9ee6273908b774a0f569e99646 (diff)
mfd: convert to idr_alloc()
Convert to the much saner new idr interface. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/rtsx_pcr.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c
index 481a98a10ecd..2f12cc13489a 100644
--- a/drivers/mfd/rtsx_pcr.c
+++ b/drivers/mfd/rtsx_pcr.c
@@ -1091,15 +1091,14 @@ static int rtsx_pci_probe(struct pci_dev *pcidev,
1091 } 1091 }
1092 handle->pcr = pcr; 1092 handle->pcr = pcr;
1093 1093
1094 if (!idr_pre_get(&rtsx_pci_idr, GFP_KERNEL)) { 1094 idr_preload(GFP_KERNEL);
1095 ret = -ENOMEM;
1096 goto free_handle;
1097 }
1098
1099 spin_lock(&rtsx_pci_lock); 1095 spin_lock(&rtsx_pci_lock);
1100 ret = idr_get_new(&rtsx_pci_idr, pcr, &pcr->id); 1096 ret = idr_alloc(&rtsx_pci_idr, pcr, 0, 0, GFP_NOWAIT);
1097 if (ret >= 0)
1098 pcr->id = ret;
1101 spin_unlock(&rtsx_pci_lock); 1099 spin_unlock(&rtsx_pci_lock);
1102 if (ret) 1100 idr_preload_end();
1101 if (ret < 0)
1103 goto free_handle; 1102 goto free_handle;
1104 1103
1105 pcr->pci = pcidev; 1104 pcr->pci = pcidev;