Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359330
b: refs/heads/master
c: 69ee266
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 28, 2013
1 parent 8962469 commit fce0b4b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 615f2e5c531bc57d5a190f321d697988e950ae4d
refs/heads/master: 69ee266b4c890aea7505388c4e394f5757166531
16 changes: 6 additions & 10 deletions trunk/drivers/dma/dmaengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,18 +686,14 @@ static int get_dma_id(struct dma_device *device)
{
int rc;

idr_retry:
if (!idr_pre_get(&dma_idr, GFP_KERNEL))
return -ENOMEM;
mutex_lock(&dma_list_mutex);
rc = idr_get_new(&dma_idr, NULL, &device->dev_id);
mutex_unlock(&dma_list_mutex);
if (rc == -EAGAIN)
goto idr_retry;
else if (rc != 0)
return rc;

return 0;
rc = idr_alloc(&dma_idr, NULL, 0, 0, GFP_KERNEL);
if (rc >= 0)
device->dev_id = rc;

mutex_unlock(&dma_list_mutex);
return rc < 0 ? rc : 0;
}

/**
Expand Down

0 comments on commit fce0b4b

Please sign in to comment.