mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
mtd: convert to idr_alloc()
Convert to the much saner new idr interface. Signed-off-by: Tejun Heo <[email protected]> Tested-by: Ezequiel Garcia <[email protected]> Cc: David Woodhouse <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
803d9e043d
commit
589e9c4dac
1 changed files with 2 additions and 7 deletions
|
|
@ -349,13 +349,8 @@ int add_mtd_device(struct mtd_info *mtd)
|
|||
BUG_ON(mtd->writesize == 0);
|
||||
mutex_lock(&mtd_table_mutex);
|
||||
|
||||
do {
|
||||
if (!idr_pre_get(&mtd_idr, GFP_KERNEL))
|
||||
goto fail_locked;
|
||||
error = idr_get_new(&mtd_idr, mtd, &i);
|
||||
} while (error == -EAGAIN);
|
||||
|
||||
if (error)
|
||||
i = idr_alloc(&mtd_idr, mtd, 0, 0, GFP_KERNEL);
|
||||
if (i < 0)
|
||||
goto fail_locked;
|
||||
|
||||
mtd->index = i;
|
||||
|
|
|
|||
Loading…
Reference in a new issue