Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jingoo Han and committed by
Lee Jones
eac1dcbd 7a404311

+2 -6
+2 -6
drivers/mfd/tps65010.c
··· 530 530 free_irq(client->irq, tps); 531 531 cancel_delayed_work_sync(&tps->work); 532 532 debugfs_remove(tps->file); 533 - kfree(tps); 534 533 the_tps = NULL; 535 534 return 0; 536 535 } ··· 549 550 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 550 551 return -EINVAL; 551 552 552 - tps = kzalloc(sizeof *tps, GFP_KERNEL); 553 + tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL); 553 554 if (!tps) 554 555 return -ENOMEM; 555 556 ··· 567 568 if (status < 0) { 568 569 dev_dbg(&client->dev, "can't get IRQ %d, err %d\n", 569 570 client->irq, status); 570 - goto fail1; 571 + return status; 571 572 } 572 573 /* annoying race here, ideally we'd have an option 573 574 * to claim the irq now and enable it later. ··· 667 668 } 668 669 669 670 return 0; 670 - fail1: 671 - kfree(tps); 672 - return status; 673 671 } 674 672 675 673 static const struct i2c_device_id tps65010_id[] = {