summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdcore.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2013-03-27 14:02:27 +0100
committerJiri Kosina <jkosina@suse.cz>2013-03-27 14:02:27 +0100
commitb3fecf8cab6441527ab057c99d7e6a6d7f6713e5 (patch)
treed327499840a25fbd1f81e49d5cb6769bdad382f5 /drivers/mtd/mtdcore.c
parent5b62efd8250d6a751c31d1972e96bfccd19c4679 (diff)
parent83a44ac8bf4a8e6cbbf0c00ff281a482778f708a (diff)
downloadop-kernel-dev-b3fecf8cab6441527ab057c99d7e6a6d7f6713e5.zip
op-kernel-dev-b3fecf8cab6441527ab057c99d7e6a6d7f6713e5.tar.gz
Merge branch 'for-3.10/hid-driver-transport-cleanups' into for-3.10/mt-hybrid-finger-pen
Diffstat (limited to 'drivers/mtd/mtdcore.c')
-rw-r--r--drivers/mtd/mtdcore.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index ec794a7..61d5f56 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -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;
OpenPOWER on IntegriCloud