Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302194
b: refs/heads/master
c: 19a8da2
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Apr 10, 2012
1 parent e12c0ef commit 82b5e54
Show file tree
Hide file tree
Showing 2 changed files with 4 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: 9a4bdd87a29bf297d9046410b011d726d51c3999
refs/heads/master: 19a8da2187249c02574ccffaf72637eb224d11c4
14 changes: 3 additions & 11 deletions trunk/drivers/regulator/tps65023-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,16 +394,16 @@ static int __devinit tps_65023_probe(struct i2c_client *client,
if (!init_data)
return -EIO;

tps = kzalloc(sizeof(*tps), GFP_KERNEL);
tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL);
if (!tps)
return -ENOMEM;

tps->regmap = regmap_init_i2c(client, &tps65023_regmap_config);
tps->regmap = devm_regmap_init_i2c(client, &tps65023_regmap_config);
if (IS_ERR(tps->regmap)) {
error = PTR_ERR(tps->regmap);
dev_err(&client->dev, "Failed to allocate register map: %d\n",
error);
goto fail_alloc;
return error;
}

/* common for all regulators */
Expand Down Expand Up @@ -449,10 +449,6 @@ static int __devinit tps_65023_probe(struct i2c_client *client,
fail:
while (--i >= 0)
regulator_unregister(tps->rdev[i]);

regmap_exit(tps->regmap);
fail_alloc:
kfree(tps);
return error;
}

Expand All @@ -463,10 +459,6 @@ static int __devexit tps_65023_remove(struct i2c_client *client)

for (i = 0; i < TPS65023_NUM_REGULATOR; i++)
regulator_unregister(tps->rdev[i]);

regmap_exit(tps->regmap);
kfree(tps);

return 0;
}

Expand Down

0 comments on commit 82b5e54

Please sign in to comment.