Hi Laxman,

Thank you for your suggestion.

On 8 January 2013 16:38, Laxman Dewangan <[email protected]> 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 <[email protected]>
>> Cc: Joonyoung Shim <[email protected]>
>> ---
>> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to