Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302205
b: refs/heads/master
c: b7bd05b
h: refs/heads/master
i:
  302203: 051c50b
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Apr 13, 2012
1 parent 024861e commit 3fa0da2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 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: ef6bd5a3f128254bee0b9052f3813ca3c3c82fb5
refs/heads/master: b7bd05b8d546cebbf05e98194b54d7b122aadf0e
16 changes: 5 additions & 11 deletions trunk/drivers/regulator/max1586.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,17 @@ static int __devinit max1586_pmic_probe(struct i2c_client *client,
struct max1586_data *max1586;
int i, id, ret = -ENOMEM;

max1586 = kzalloc(sizeof(struct max1586_data) +
max1586 = devm_kzalloc(&client->dev, sizeof(struct max1586_data) +
sizeof(struct regulator_dev *) * (MAX1586_V6 + 1),
GFP_KERNEL);
if (!max1586)
goto out;
return -ENOMEM;

max1586->client = client;

if (!pdata->v3_gain) {
ret = -EINVAL;
goto out_unmap;
}
if (!pdata->v3_gain)
return -EINVAL;

max1586->min_uV = MAX1586_V3_MIN_UV / 1000 * pdata->v3_gain / 1000;
max1586->max_uV = MAX1586_V3_MAX_UV / 1000 * pdata->v3_gain / 1000;

Expand Down Expand Up @@ -234,9 +233,6 @@ static int __devinit max1586_pmic_probe(struct i2c_client *client,
err:
while (--i >= 0)
regulator_unregister(rdev[i]);
out_unmap:
kfree(max1586);
out:
return ret;
}

Expand All @@ -248,8 +244,6 @@ static int __devexit max1586_pmic_remove(struct i2c_client *client)
for (i = 0; i <= MAX1586_V6; i++)
if (max1586->rdev[i])
regulator_unregister(max1586->rdev[i]);
kfree(max1586);

return 0;
}

Expand Down

0 comments on commit 3fa0da2

Please sign in to comment.