Hi Laxman, Thank you for your suggestion. On 8 January 2013 16:38, Laxman Dewangan <ldewangan@xxxxxxxxxx> wrote: > On Tuesday 08 January 2013 03:35 PM, Sachin Kamat wrote: >> >> devm_* APIs are device managed and make the exit and clean up code >> simpler. >> >> Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx> >> Cc: Joonyoung Shim <jy0922.shim@xxxxxxxxxxx> >> --- >> Compile tested against linux-next tree (20130108). >> --- >> drivers/input/touchscreen/mms114.c | 41 >> +++++++++++------------------------ >> 1 files changed, 13 insertions(+), 28 deletions(-) > > >> static int mms114_remove(struct i2c_client *client) >> { >> struct mms114_data *data = i2c_get_clientdata(client); >> - free_irq(client->irq, data); >> - regulator_put(data->io_reg); >> - regulator_put(data->core_reg); >> input_unregister_device(data->input_dev); > > > Because you are using devm_input_allocate_device() for allocating input > device, you need not to have the input_unregister_device() and so you can > get rid of remove() callback at all. > This is what I learnt from Dmitry on similar patch for Tegra KBC. input_free_device() is the one which is not required when you use devm_input_allocate_device(). Unregister call, AFAIK, is required since we are registering using input_register_device(). Dmitry, please let me know if my understanding is right. > > Thanks, > Laxman -- With warm regards, Sachin -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html