projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3ab4ee8
)
misc/tifm_core: convert to idr_alloc()
author
Tejun Heo
<
[email protected]
>
Thu, 28 Feb 2013 01:04:31 +0000
(17:04 -0800)
committer
Linus Torvalds
<
[email protected]
>
Thu, 28 Feb 2013 03:10:17 +0000
(19:10 -0800)
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo <
[email protected]
>
Cc: Arnd Bergmann <
[email protected]
>
Cc: Alex Dubov <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/misc/tifm_core.c
patch
|
blob
|
history
diff --git
a/drivers/misc/tifm_core.c
b/drivers/misc/tifm_core.c
index 0bd5349b04228ca0b784c44d4ea5dd6770450472..0ab7c922212cd860703d78a85621bfe68a067825 100644
(file)
--- a/
drivers/misc/tifm_core.c
+++ b/
drivers/misc/tifm_core.c
@@
-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);