Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359359
b: refs/heads/master
c: 05e2cef
h: refs/heads/master
i:
  359357: e4ccb70
  359355: e7819f8
  359351: 7f6d45c
  359343: b3b04a1
  359327: a0d0aa6
  359295: 263e944
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 28, 2013
1 parent de1eda4 commit 5a16415
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 22 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: 2fa532c5d5af8959d1b0ea369324f6d44183dba4
refs/heads/master: 05e2cefab4acb5ae9b54266935eeec32cc5269ea
11 changes: 3 additions & 8 deletions trunk/drivers/power/bq2415x_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
9 changes: 3 additions & 6 deletions trunk/drivers/power/bq27x00_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,14 +791,11 @@ static int bq27x00_battery_probe(struct i2c_client *client,
int retval = 0;

/* Get new ID for the new battery device */
retval = idr_pre_get(&battery_id, GFP_KERNEL);
if (retval == 0)
return -ENOMEM;
mutex_lock(&battery_mutex);
retval = idr_get_new(&battery_id, client, &num);
num = idr_alloc(&battery_id, client, 0, 0, GFP_KERNEL);
mutex_unlock(&battery_mutex);
if (retval < 0)
return retval;
if (num < 0)
return num;

name = kasprintf(GFP_KERNEL, "%s-%d", id->name, num);
if (!name) {
Expand Down
9 changes: 2 additions & 7 deletions trunk/drivers/power/ds2782_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,17 +395,12 @@ static int ds278x_battery_probe(struct i2c_client *client,
}

/* Get an ID for this battery */
ret = idr_pre_get(&battery_id, GFP_KERNEL);
if (ret == 0) {
ret = -ENOMEM;
goto fail_id;
}

mutex_lock(&battery_lock);
ret = idr_get_new(&battery_id, client, &num);
ret = idr_alloc(&battery_id, client, 0, 0, GFP_KERNEL);
mutex_unlock(&battery_lock);
if (ret < 0)
goto fail_id;
num = ret;

info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info) {
Expand Down

0 comments on commit 5a16415

Please sign in to comment.