diff options
Diffstat (limited to 'drivers/dma/dmaengine.c')
-rw-r--r-- | drivers/dma/dmaengine.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 242b8c0a3de8..b2728d6ba2fd 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c | |||
@@ -686,18 +686,14 @@ static int get_dma_id(struct dma_device *device) | |||
686 | { | 686 | { |
687 | int rc; | 687 | int rc; |
688 | 688 | ||
689 | idr_retry: | ||
690 | if (!idr_pre_get(&dma_idr, GFP_KERNEL)) | ||
691 | return -ENOMEM; | ||
692 | mutex_lock(&dma_list_mutex); | 689 | mutex_lock(&dma_list_mutex); |
693 | rc = idr_get_new(&dma_idr, NULL, &device->dev_id); | ||
694 | mutex_unlock(&dma_list_mutex); | ||
695 | if (rc == -EAGAIN) | ||
696 | goto idr_retry; | ||
697 | else if (rc != 0) | ||
698 | return rc; | ||
699 | 690 | ||
700 | return 0; | 691 | rc = idr_alloc(&dma_idr, NULL, 0, 0, GFP_KERNEL); |
692 | if (rc >= 0) | ||
693 | device->dev_id = rc; | ||
694 | |||
695 | mutex_unlock(&dma_list_mutex); | ||
696 | return rc < 0 ? rc : 0; | ||
701 | } | 697 | } |
702 | 698 | ||
703 | /** | 699 | /** |