mfd: palmas: Provide irq flags through DT/platform data
[cascardo/linux.git] / drivers / power / bq2415x_charger.c
index ca91396..0727f92 100644 (file)
@@ -1515,16 +1515,11 @@ static int bq2415x_probe(struct i2c_client *client,
        }
 
        /* Get new ID for the new device */
-       ret = idr_pre_get(&bq2415x_id, GFP_KERNEL);
-       if (ret == 0)
-               return -ENOMEM;
-
        mutex_lock(&bq2415x_id_mutex);
-       ret = idr_get_new(&bq2415x_id, client, &num);
+       num = idr_alloc(&bq2415x_id, client, 0, 0, GFP_KERNEL);
        mutex_unlock(&bq2415x_id_mutex);
-
-       if (ret < 0)
-               return ret;
+       if (num < 0)
+               return num;
 
        name = kasprintf(GFP_KERNEL, "%s-%d", id->name, num);
        if (!name) {