Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302304
b: refs/heads/master
c: 372de4a
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed May 16, 2012
1 parent b7e9496 commit 24569d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 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: dde2b724e6bd6a6ea8516345398d3b8fe06a031b
refs/heads/master: 372de4aa5e27af81ac4ce3b7be264e36a1d70a01
11 changes: 3 additions & 8 deletions trunk/drivers/regulator/max8952.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ static int __devinit max8952_pmic_probe(struct i2c_client *client,
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE))
return -EIO;

max8952 = kzalloc(sizeof(struct max8952_data), GFP_KERNEL);
max8952 = devm_kzalloc(&client->dev, sizeof(struct max8952_data),
GFP_KERNEL);
if (!max8952)
return -ENOMEM;

Expand All @@ -198,7 +199,7 @@ static int __devinit max8952_pmic_probe(struct i2c_client *client,
if (IS_ERR(max8952->rdev)) {
ret = PTR_ERR(max8952->rdev);
dev_err(max8952->dev, "regulator init failed (%d)\n", ret);
goto err_reg;
return ret;
}

max8952->en = !!(pdata->reg_data.constraints.boot_on);
Expand Down Expand Up @@ -295,10 +296,6 @@ static int __devinit max8952_pmic_probe(struct i2c_client *client,
i2c_set_clientdata(client, max8952);

return 0;

err_reg:
kfree(max8952);
return ret;
}

static int __devexit max8952_pmic_remove(struct i2c_client *client)
Expand All @@ -312,8 +309,6 @@ static int __devexit max8952_pmic_remove(struct i2c_client *client)
gpio_free(pdata->gpio_vid0);
gpio_free(pdata->gpio_vid1);
gpio_free(pdata->gpio_en);

kfree(max8952);
return 0;
}

Expand Down

0 comments on commit 24569d6

Please sign in to comment.