@@ -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;
}