return 0;
 }
 
+static void adp5589_clear_config(void *data)
+{
+       struct i2c_client *client = data;
+       struct adp5589_kpad *kpad = i2c_get_clientdata(client);
+
+       adp5589_write(client, kpad->var->reg(ADP5589_GENERAL_CFG), 0);
+}
+
 static int adp5589_probe(struct i2c_client *client,
                         const struct i2c_device_id *id)
 {
                break;
        }
 
+       error = devm_add_action_or_reset(&client->dev, adp5589_clear_config,
+                                        client);
+       if (error)
+               return error;
+
        ret = adp5589_read(client, ADP5589_5_ID);
        if (ret < 0)
                return ret;
        return 0;
 }
 
-static int adp5589_remove(struct i2c_client *client)
-{
-       struct adp5589_kpad *kpad = i2c_get_clientdata(client);
-
-       adp5589_write(client, kpad->var->reg(ADP5589_GENERAL_CFG), 0);
-
-       return 0;
-}
-
 #ifdef CONFIG_PM_SLEEP
 static int adp5589_suspend(struct device *dev)
 {
                .pm = &adp5589_dev_pm_ops,
        },
        .probe = adp5589_probe,
-       .remove = adp5589_remove,
        .id_table = adp5589_id,
 };