diff mbox

[2/4] power: max17042_battery: Use devm_* function for requesting irq

Message ID 1401939977-20328-3-git-send-email-jonghwa3.lee@samsung.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Jonghwa Lee June 5, 2014, 3:46 a.m. UTC
This patch modifies driver to use devm_request_threaded_irq() to simplify
the driver.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
---
 drivers/power/max17042_battery.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c
index 1266760..cee3912 100644
--- a/drivers/power/max17042_battery.c
+++ b/drivers/power/max17042_battery.c
@@ -745,8 +745,8 @@  static int max17042_probe(struct i2c_client *client,
 	}
 
 	if (client->irq) {
-		ret = request_threaded_irq(client->irq, NULL,
-					max17042_thread_handler,
+		ret = devm_request_threaded_irq(&client->dev, client->irq,
+					NULL, max17042_thread_handler,
 					IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
 					chip->battery.name, chip);
 		if (!ret) {
@@ -776,8 +776,6 @@  static int max17042_remove(struct i2c_client *client)
 {
 	struct max17042_chip *chip = i2c_get_clientdata(client);
 
-	if (client->irq)
-		free_irq(client->irq, chip);
 	power_supply_unregister(&chip->battery);
 	return 0;
 }