Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359354
b: refs/heads/master
c: 57f2667
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 28, 2013
1 parent 7dccf4c commit 646b1a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 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: 3ab4ee8f809cac9587e6795243349beda179f6ff
refs/heads/master: 57f2667cc7ebf69bd5fdb26f132228d331766ea8
11 changes: 6 additions & 5 deletions trunk/drivers/misc/tifm_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,14 @@ int tifm_add_adapter(struct tifm_adapter *fm)
{
int rc;

if (!idr_pre_get(&tifm_adapter_idr, GFP_KERNEL))
return -ENOMEM;

idr_preload(GFP_KERNEL);
spin_lock(&tifm_adapter_lock);
rc = idr_get_new(&tifm_adapter_idr, fm, &fm->id);
rc = idr_alloc(&tifm_adapter_idr, fm, 0, 0, GFP_NOWAIT);
if (rc >= 0)
fm->id = rc;
spin_unlock(&tifm_adapter_lock);
if (rc)
idr_preload_end();
if (rc < 0)
return rc;

dev_set_name(&fm->dev, "tifm%u", fm->id);
Expand Down

0 comments on commit 646b1a3

Please sign in to comment.