diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-08-20 03:05:54 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2013-08-20 03:51:48 -0400 |
commit | eac1dcbd3e211998fb8342902b3acee149a9271d (patch) | |
tree | 6de0e97cfda381be518d0bde498abaa3be072d28 | |
parent | 7a4043112778c8ba7169b3006c8b7789213c878a (diff) |
mfd: tps65010: Use devm_*() functions
Use devm_*() functions to make cleanup paths simpler.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r-- | drivers/mfd/tps65010.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/mfd/tps65010.c b/drivers/mfd/tps65010.c index 8114567e0695..743fb524fc8a 100644 --- a/drivers/mfd/tps65010.c +++ b/drivers/mfd/tps65010.c | |||
@@ -530,7 +530,6 @@ static int __exit tps65010_remove(struct i2c_client *client) | |||
530 | free_irq(client->irq, tps); | 530 | free_irq(client->irq, tps); |
531 | cancel_delayed_work_sync(&tps->work); | 531 | cancel_delayed_work_sync(&tps->work); |
532 | debugfs_remove(tps->file); | 532 | debugfs_remove(tps->file); |
533 | kfree(tps); | ||
534 | the_tps = NULL; | 533 | the_tps = NULL; |
535 | return 0; | 534 | return 0; |
536 | } | 535 | } |
@@ -550,7 +549,7 @@ static int tps65010_probe(struct i2c_client *client, | |||
550 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 549 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
551 | return -EINVAL; | 550 | return -EINVAL; |
552 | 551 | ||
553 | tps = kzalloc(sizeof *tps, GFP_KERNEL); | 552 | tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL); |
554 | if (!tps) | 553 | if (!tps) |
555 | return -ENOMEM; | 554 | return -ENOMEM; |
556 | 555 | ||
@@ -568,7 +567,7 @@ static int tps65010_probe(struct i2c_client *client, | |||
568 | if (status < 0) { | 567 | if (status < 0) { |
569 | dev_dbg(&client->dev, "can't get IRQ %d, err %d\n", | 568 | dev_dbg(&client->dev, "can't get IRQ %d, err %d\n", |
570 | client->irq, status); | 569 | client->irq, status); |
571 | goto fail1; | 570 | return status; |
572 | } | 571 | } |
573 | /* annoying race here, ideally we'd have an option | 572 | /* annoying race here, ideally we'd have an option |
574 | * to claim the irq now and enable it later. | 573 | * to claim the irq now and enable it later. |
@@ -668,9 +667,6 @@ static int tps65010_probe(struct i2c_client *client, | |||
668 | } | 667 | } |
669 | 668 | ||
670 | return 0; | 669 | return 0; |
671 | fail1: | ||
672 | kfree(tps); | ||
673 | return status; | ||
674 | } | 670 | } |
675 | 671 | ||
676 | static const struct i2c_device_id tps65010_id[] = { | 672 | static const struct i2c_device_id tps65010_id[] = { |