Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345056
b: refs/heads/master
c: 1881b68
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Samuel Ortiz committed Dec 10, 2012
1 parent 0b721b4 commit b52c85b
Show file tree
Hide file tree
Showing 2 changed files with 5 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: ac713cc9fcb8a5f9503af08421772b85ca4685f1
refs/heads/master: 1881b68b8961a86d40c3c5c205e533515a2dc9c6
21 changes: 4 additions & 17 deletions trunk/drivers/mfd/tps6507x.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ static int tps6507x_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
struct tps6507x_dev *tps6507x;
int ret = 0;

tps6507x = kzalloc(sizeof(struct tps6507x_dev), GFP_KERNEL);
tps6507x = devm_kzalloc(&i2c->dev, sizeof(struct tps6507x_dev),
GFP_KERNEL);
if (tps6507x == NULL)
return -ENOMEM;

Expand All @@ -98,28 +98,15 @@ static int tps6507x_i2c_probe(struct i2c_client *i2c,
tps6507x->read_dev = tps6507x_i2c_read_device;
tps6507x->write_dev = tps6507x_i2c_write_device;

ret = mfd_add_devices(tps6507x->dev, -1,
tps6507x_devs, ARRAY_SIZE(tps6507x_devs),
NULL, 0, NULL);

if (ret < 0)
goto err;

return ret;

err:
mfd_remove_devices(tps6507x->dev);
kfree(tps6507x);
return ret;
return mfd_add_devices(tps6507x->dev, -1, tps6507x_devs,
ARRAY_SIZE(tps6507x_devs), NULL, 0, NULL);
}

static int tps6507x_i2c_remove(struct i2c_client *i2c)
{
struct tps6507x_dev *tps6507x = i2c_get_clientdata(i2c);

mfd_remove_devices(tps6507x->dev);
kfree(tps6507x);

return 0;
}

Expand Down

0 comments on commit b52c85b

Please sign in to comment.