提交 9f12563d 编写于 作者: T Tejun Heo 提交者: Linus Torvalds

mfd: convert to idr_alloc()

Convert to the much saner new idr interface.
Signed-off-by: NTejun Heo <tj@kernel.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 7b51f478
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册