Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308762
b: refs/heads/master
c: fa648e5
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hovold authored and Samuel Ortiz committed May 20, 2012
1 parent 35db431 commit a396574
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 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: 16e5e204c92800aad4e7db52d289565cc82240ce
refs/heads/master: fa648e51f84d060ef991eeee4d7bacec45d7fbfd
22 changes: 5 additions & 17 deletions trunk/drivers/mfd/lm3533-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,33 +603,24 @@ static int __devinit lm3533_i2c_probe(struct i2c_client *i2c,

dev_dbg(&i2c->dev, "%s\n", __func__);

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

i2c_set_clientdata(i2c, lm3533);

lm3533->regmap = regmap_init_i2c(i2c, &regmap_config);
if (IS_ERR(lm3533->regmap)) {
ret = PTR_ERR(lm3533->regmap);
goto err_regmap;
}
lm3533->regmap = devm_regmap_init_i2c(i2c, &regmap_config);
if (IS_ERR(lm3533->regmap))
return PTR_ERR(lm3533->regmap);

lm3533->dev = &i2c->dev;
lm3533->irq = i2c->irq;

ret = lm3533_device_init(lm3533);
if (ret)
goto err_dev;
return ret;

return 0;

err_dev:
regmap_exit(lm3533->regmap);
err_regmap:
kfree(lm3533);

return ret;
}

static int __devexit lm3533_i2c_remove(struct i2c_client *i2c)
Expand All @@ -639,9 +630,6 @@ static int __devexit lm3533_i2c_remove(struct i2c_client *i2c)
dev_dbg(&i2c->dev, "%s\n", __func__);

lm3533_device_exit(lm3533);
regmap_exit(lm3533->regmap);

kfree(lm3533);

return 0;
}
Expand Down

0 comments on commit a396574

Please sign in to comment.