Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373214
b: refs/heads/master
c: aa4dcf5
h: refs/heads/master
v: v3
  • Loading branch information
Jingoo Han authored and Samuel Ortiz committed Apr 8, 2013
1 parent d1c4d1e commit f97640f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 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: 1ba895e0487810ee44eb08585e6810ad66159988
refs/heads/master: aa4dcf5bec80501933c6935f50f438594823c614
19 changes: 6 additions & 13 deletions trunk/drivers/mfd/da903x.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,8 @@ static int da903x_probe(struct i2c_client *client,
unsigned int tmp;
int ret;

chip = kzalloc(sizeof(struct da903x_chip), GFP_KERNEL);
chip = devm_kzalloc(&client->dev, sizeof(struct da903x_chip),
GFP_KERNEL);
if (chip == NULL)
return -ENOMEM;

Expand All @@ -515,42 +516,34 @@ static int da903x_probe(struct i2c_client *client,

ret = chip->ops->init_chip(chip);
if (ret)
goto out_free_chip;
return ret;

/* mask and clear all IRQs */
chip->events_mask = 0xffffffff;
chip->ops->mask_events(chip, chip->events_mask);
chip->ops->read_events(chip, &tmp);

ret = request_irq(client->irq, da903x_irq_handler,
ret = devm_request_irq(&client->dev, client->irq, da903x_irq_handler,
IRQF_TRIGGER_FALLING,
"da903x", chip);
if (ret) {
dev_err(&client->dev, "failed to request irq %d\n",
client->irq);
goto out_free_chip;
return ret;
}

ret = da903x_add_subdevs(chip, pdata);
if (ret)
goto out_free_irq;
return ret;

return 0;

out_free_irq:
free_irq(client->irq, chip);
out_free_chip:
kfree(chip);
return ret;
}

static int da903x_remove(struct i2c_client *client)
{
struct da903x_chip *chip = i2c_get_clientdata(client);

da903x_remove_subdevs(chip);
free_irq(client->irq, chip);
kfree(chip);
return 0;
}

Expand Down

0 comments on commit f97640f

Please sign in to comment.