Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373215
b: refs/heads/master
c: 1383e00
h: refs/heads/master
i:
  373213: d1c4d1e
  373211: 9ca6259
  373207: 0bc6938
  373199: fef85c2
  373183: b74b188
v: v3
  • Loading branch information
Jingoo Han authored and Samuel Ortiz committed Apr 8, 2013
1 parent f97640f commit 08d6fa6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 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: aa4dcf5bec80501933c6935f50f438594823c614
refs/heads/master: 1383e00f79a7bd6333083a12b43481b6bf2bdcb4
21 changes: 6 additions & 15 deletions trunk/drivers/mfd/tc3589x.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ static int tc3589x_probe(struct i2c_client *i2c,
| I2C_FUNC_SMBUS_I2C_BLOCK))
return -EIO;

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

Expand All @@ -366,33 +367,27 @@ static int tc3589x_probe(struct i2c_client *i2c,

ret = tc3589x_chip_init(tc3589x);
if (ret)
goto out_free;
return ret;

ret = tc3589x_irq_init(tc3589x, np);
if (ret)
goto out_free;
return ret;

ret = request_threaded_irq(tc3589x->i2c->irq, NULL, tc3589x_irq,
IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
"tc3589x", tc3589x);
if (ret) {
dev_err(tc3589x->dev, "failed to request IRQ: %d\n", ret);
goto out_free;
return ret;
}

ret = tc3589x_device_init(tc3589x);
if (ret) {
dev_err(tc3589x->dev, "failed to add child devices\n");
goto out_freeirq;
return ret;
}

return 0;

out_freeirq:
free_irq(tc3589x->i2c->irq, tc3589x);
out_free:
kfree(tc3589x);
return ret;
}

static int tc3589x_remove(struct i2c_client *client)
Expand All @@ -401,10 +396,6 @@ static int tc3589x_remove(struct i2c_client *client)

mfd_remove_devices(tc3589x->dev);

free_irq(tc3589x->i2c->irq, tc3589x);

kfree(tc3589x);

return 0;
}

Expand Down

0 comments on commit 08d6fa6

Please sign in to comment.